Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
pygame_lesson6_diy1
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
45ccd00d
authored
Jan 23, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
a756d6f0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletions
my_music.py
my_music.py
View file @
45ccd00d
...
@@ -77,7 +77,7 @@ while True:
...
@@ -77,7 +77,7 @@ while True:
if
x
>
120
and
x
<
220
and
y
>
350
and
y
<
400
:
if
x
>
120
and
x
<
220
and
y
>
350
and
y
<
400
:
num
-=
1
num
-=
1
if
num
<
0
:
if
num
<
0
:
num
=
len
(
file
list
)
-
1
num
=
len
(
music_
list
)
-
1
pygame
.
mixer
.
music
.
load
(
path
+
"
\\
"
+
music_list
[
num
])
pygame
.
mixer
.
music
.
load
(
path
+
"
\\
"
+
music_list
[
num
])
pygame
.
mixer
.
music
.
play
()
pygame
.
mixer
.
music
.
play
()
play_button
=
stop_img
play_button
=
stop_img
...
@@ -100,6 +100,7 @@ while True:
...
@@ -100,6 +100,7 @@ while True:
music1
=
pygame
.
mixer
.
Sound
(
path
+
"
\\
"
+
music_list
[
num
])
music1
=
pygame
.
mixer
.
Sound
(
path
+
"
\\
"
+
music_list
[
num
])
#获取音乐长度,以秒为单位
#获取音乐长度,以秒为单位
music_length
=
int
(
music1
.
get_length
())
music_length
=
int
(
music1
.
get_length
())
#歌曲播放进度时间
#歌曲播放进度时间
play_time
=
pygame
.
mixer
.
music
.
get_pos
()
play_time
=
pygame
.
mixer
.
music
.
get_pos
()
#展示秒数的换算
#展示秒数的换算
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment