This article gives an example of how Pygame plays music. Share to everyone for your reference. Specifically as follows:
|1 2 3 4||Import pygame filename= '/home/a.mp3 ' pygame.mixer.music.load (filename) pygame.mixer.music.play (loops=0, start=0.0)|
|1 2 3 4 5||Import pygame filename= '/home/pengtao/music/b.mp3 ' Pygame.mixer.init () pygame.mixer.music.load (filename) Pygame.mixer.music.play (1)|
I hope this article will help you with your Python programming.