python pygame播放音频文件
python pygame播放音频文件
pip install pygame
import pygame # Initialize pygame pygame.init() # Load the MP3 file pygame.mixer.music.load("1.mp3") # Play the MP3 file pygame.mixer.music.play() # Wait for the MP3 file to finish playing while pygame.mixer.music.get_busy(): pygame.time.Clock().tick(10) # Clean up pygame.quit()
########################
QQ 3087438119