-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwhy.py
44 lines (32 loc) · 1.23 KB
/
why.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
37
38
39
40
41
42
43
44
## why.py ######################################################################
## why u do dis to me ##########################################################
################################################################################
from pygame import mixer # Load the required library
import pygame
import multiprocessing as mp
def playMusic(musicName):
pygame.mixer.music.load('./data/%s' % musicName)
pygame.mixer.music.play(0)
clock = pygame.time.Clock()
clock.tick(10)
while pygame.mixer.music.get_busy():
pygame.event.poll()
clock.tick(10)
def runMultithreaded():
p1 = mp.Process(target = playMusic, args=("ebonHawkMainHold.mp3",), name = "mainHold")
p2 = mp.Process(target = playMusic, args=("ebonHawkEngineRoom.mp3",), name = "engineRoom")
procs = [p1, p2]
for p in procs:
p.start()
def runLinear():
p1 = mp.Process(target = playMusic, args=("ebonHawkMainHold.mp3",), name = "mainHold")
p2 = mp.Process(target = playMusic, args=("ebonHawkEngineRoom.mp3",), name = "engineRoom")
procs = [p1, p2]
p1.start()
if(__name__ == "__main__"):
pygame.init()
##pygame.display.set_mode((200,100))
##pygame.mixer.music.load('./data/acousticSunrise.ogg')
##pygame.mixer.music.play(0)
##runMultithreaded()
runLinear()