-
Notifications
You must be signed in to change notification settings - Fork 0
/
music.py
37 lines (31 loc) · 1.24 KB
/
music.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from pygame import mixer
mixer.init()
def mymusic(user):
if user == "1":
mixer.music.load("one.ogg") # Loading the song
mixer.music.set_volume(0.7) # Setting the volume
mixer.music.play() # Start playing the song
return
if user == "2":
mixer.music.load("two.ogg") # Loading the song
mixer.music.set_volume(0.7) # Setting the volume
mixer.music.play() # Start playing the song
return
if user == "3":
mixer.music.load("three.ogg") # Loading the song
mixer.music.set_volume(0.7) # Setting the volume
mixer.music.play() # Start playing the song
return
if user == "4":
mixer.music.load("four.ogg") # Loading the song
mixer.music.set_volume(0.7) # Setting the volume
mixer.music.play() # Start playing the song
return
if user == "5":
mixer.music.load("five.ogg") # Loading the song
mixer.music.set_volume(0.7) # Setting the volume
mixer.music.play() # Start playing the song
return
if user == "#":
mixer.music.stop() # Stop playing the song
return