-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPImp3
71 lines (63 loc) · 1.51 KB
/
PImp3
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import pygame
def pmusic(file):
pygame.init()
pygame.mixer.init()
clock = pygame.time.Clock()
pygame.mixer.music.load(file)
pygame.mixer.music.play()
while pygame.mixer.music.get_busy():
clock.tick(1000)
def stopmusic():
pygame.mixer.music.stop()
def getmixerargs():
pygame.mixer.init()
freq, size, chan = pygame.mixer.get_init()
return freq, size, chan
def initMixer():
BUFFER = 3072 # audio buffer size, number of samples since pygame 1.8.
FREQ, SIZE, CHAN = getmixerargs()
pygame.mixer.init(FREQ, SIZE, CHAN, BUFFER)
def sounds0(file):
file ='foldername/mp3name.mp3'
initMixer()
pmusic(file)
def sounds1(file):
file ='foldername/mp3name.mp3'
initMixer()
pmusic(file)
def sounds2(file):
file ='foldername/mp3name.mp3'
initMixer()
pmusic(file)
def sounds3(file):
file ='foldername/mp3name.mp3'
initMixer()
pmusic(file)
def sounds4(file):
file ='foldername/mp3name.mp3'
initMixer()
pmusic(file)
def sounds5(file):
file ='foldername/mp3name.mp3'
initMixer()
pmusic(file)
def sounds6(file):
file ='foldername/mp3name.mp3'
initMixer()
pmusic(file)
def sounds7(file):
file ='foldername/mp3name.mp3'
initMixer()
pmusic(file)
def sounds8(file):
file ='foldername/mp3name.mp3'
initMixer()
pmusic(file)
def sounds9(file):
file ='foldername/mp3name.mp3'
initMixer()
pmusic(file)
def sounds10(file):
file='foldername/mp3name.mp3''
initMixer()
pmusic(file)