Created
November 4, 2016 23:46
-
-
Save andreztz/afc1bf104f81039204e1cf62af0750cc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pygame | |
| class Player(object): | |
| def __init__(self, localmp3): | |
| self.localmp3 = localmp3 | |
| self.play() | |
| def play(self): | |
| pygame.mixer.init() | |
| pygame.mixer.pre_init(44100, 16, 2, 5000) | |
| pygame.mixer_music.load(self.localmp3) | |
| pygame.mixer_music.play(-1) | |
| while pygame.mixer_music.get_busy(): | |
| pygame.time.Clock().tick(10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment