python播放wav音频文件代码

2015-06-18 0 927
python播放wav音频文件代码
# play a wave sound on a Windows Box
# Python23 tested   vegaseat   2/8/2005
import winsound
import time
# pick a wave file supplied by Windows XP or one of your own ...
# soundfile = "c:\\Windows\\Media\\chimes.wav"
# Python also accepts the forward slash
soundfile = "c:/Windows/Media/chimes.wav"
winsound.PlaySound(soundfile, winsound.SND_FILENAME|winsound.SND_ASYNC)
# wait one and a half seconds
time.sleep(1.5)
# play the system exit sound if set
winsound.PlaySound("SystemExit", winsound.SND_ALIAS)

遇见资源网 python python播放wav音频文件代码 http://www.ox520.com/15531.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务