我想使用 playsound 添加一些声音,它工作了一段时间没有问题。但是当我今天尝试运行代码时,它突然给了我这个错误。文件名中没有空格。
MacOS 大苏尔 11.2.2
Python 3.9.6
from playsound import playsound
playsound('/Volumes/sDesktop/learnPython/2020simulator/Elegy_AsherFulero.mp3', block = False)
name@names-MBP 2020simulator % /usr/local/bin/python3 "/Volumes/sDesktop 1/learnPython/2020simulator/testScript5.py"
Traceback (most recent call last):
File "/Volumes/sDesktop 1/learnPython/2020simulator/testScript5.py", line 7, in <module>
playsound('/Volumes/sDesktop/learnPython/2020simulator/Elegy_AsherFulero.mp3', block = False)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/playsound.py", line 67, in _playsoundOSX
raise IOError('Unable to load sound named: ' + sound)
OSError: Unable to load sound named: file:///Volumes/sDesktop/learnPython/2020simulator/Elegy_AsherFulero.mp3
name@names-MBP 2020simulator %