当前位置:主页 > 软件编程 > Python代码 >

python使用PyGame模块播放声音的方法

时间:2021-11-20 16:22:18 | 栏目:Python代码 | 点击:

本文实例讲述了python使用PyGame模块播放声音的方法。分享给大家供大家参考。具体实现方法如下:

import pygame
pygame.init()
pygame.mixer.music.load("sound_file.ogg")
pygame.mixer.music.play()
pygame.event.wait()

希望本文所述对大家的Python程序设计有所帮助。

您可能感兴趣的文章:

相关文章