Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/python
- import pygame
- # init pygame & sound
- pygame.init()
- pygame.mixer.init()
- # load sound
- sound = pygame.mixer.music.load("demo.mp3")
- # pick channel and play
- channel = pygame.mixer.find_channel(true)
- channel.play(sound)
- # wait for end of playback
- while (channel.get_busy()):
- pygame.wait.delay(200)
- # quit sound & pygamepygame.mixer.quit()
- pygame.quit()
- quit_sound()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement