📜  如何将歌曲放入 pygame - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:41.529000             🧑  作者: Mango

代码示例1
#has to be in .mp3 format
#has to be in same folder
#load the music
pygame.mixer.music.load('song.mp3')
#play the music infinite
pygame.mixer.music.play(-1)
#or play it one time
pygame.mixer.music.play(0)