[英]How can I play a sound in python using a mac?
How can I play a sound in python
?如何在
python
中播放声音? I tried using playsound
and saying playsound('explosion.mp3')
but I get an error saying that raise IOError('Unable to load sound named: ' + sound) OSError: Unable to load sound named: file:///Users/Tyler/Desktop/Coding/Surround. v1.1/explosion.mp3
我尝试使用
playsound
并说playsound('explosion.mp3')
但我收到一个错误,说raise IOError('Unable to load sound named: ' + sound) OSError: Unable to load sound named: file:///Users/Tyler/Desktop/Coding/Surround. v1.1/explosion.mp3
raise IOError('Unable to load sound named: ' + sound) OSError: Unable to load sound named: file:///Users/Tyler/Desktop/Coding/Surround. v1.1/explosion.mp3
. raise IOError('Unable to load sound named: ' + sound) OSError: Unable to load sound named: file:///Users/Tyler/Desktop/Coding/Surround. v1.1/explosion.mp3
。 Is there a different module that works better for mac?有没有更适合mac的不同模块? Or am I doing it wrong?
还是我做错了?
Most text editors have their own sound modules.大多数文本编辑器都有自己的声音模块。 It is completely normal for some sound modules to have no effect on the text editor you are using.
某些声音模块对您正在使用的文本编辑器没有影响是完全正常的。 Try looking up
Sound module for [text-editor]
or try finding a sound module in your text editor's built in marketplace.尝试查找
Sound module for [text-editor]
的声音模块或尝试在文本编辑器的内置市场中查找声音模块。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.