Advertisement
Glocke

Pygame Sound Demo

Mar 20th, 2013
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. #!/bin/python
  2.  
  3. import pygame
  4.  
  5. # init pygame & sound
  6. pygame.init()
  7. pygame.mixer.init()
  8.  
  9. # load sound
  10. sound = pygame.mixer.music.load("demo.mp3")
  11.  
  12. # pick channel and play
  13. channel = pygame.mixer.find_channel(true)
  14. channel.play(sound)
  15.  
  16. # wait for end of playback
  17. while (channel.get_busy()):
  18.     pygame.wait.delay(200)
  19.    
  20. # quit sound & pygamepygame.mixer.quit()
  21. pygame.quit()
  22. quit_sound()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement