Python: Playing a music in the background?

寵の児 提交于 2019-11-29 08:46:14

According to the documentation you use the SND_ASYNC flag.

winsound.SND_ASYNC 
Return immediately, allowing sounds to play asynchronously.

To stop playing, call PlaySound with a NONE argument.

winsound.PlaySound(None, winsound.SND_ASYNC)

I don't have experience with this module, but it looks as though you can play sounds asynchronously. See http://docs.python.org/2/library/winsound.html and look at SND_ASYNC.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!