如何在后台运行pygame?
我制作了一个小型 pygame 应用程序,它使用 pygame.mixer 在按键中播放某些 wav 文件 一切似乎都工作得很好,除了以下事实:如果您最小化 pygame 窗口,程序将停止工作,直到您再次打开它。有没有办法解决这个问题或者用Python实现声音播放的替代方法?
I made a small pygame app that plays certain wav files in keypress using pygame.mixer
All seem to work just fine except the fact that if you minimize the pygame window the program stops working until you open it again. Is there a way to solve this issue or an alternative way to implement sound playing in python?
This is my repository: https://github.com/Souvlaki42/HighPlayer
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试使用 pygame.mixer.music() ,但您需要将所有 wav 文件转换为 mp3 文件。
Try using
pygame.mixer.music()
but you'll need to convert all your wav files into mp3 files.只需修补我从第34行的所有错误修补我的所有错误,现在应该是:
Just patch up all my mistakes your code from line 34 onwards should now be: