为什么在Python中使用playsound时出现此错误?

时间:2019-12-14 19:14:19

标签: python error-handling

代码:

from playsound import playsound
path = r"C:\Tills Vi Dör\tillsvidor"
playsound(path)

错误:

Traceback (most recent call last):
  File "C:/Users/nicol/PycharmProjects/pygame_test/test.py", line 3, in <module>
    playsound(path)
  File "C:\Users\nicol\AppData\Local\Programs\Python\Python38-32\lib\site-packages\playsound.py", line 35, in _playsoundWin
    winCommand('open "' + sound + '" alias', alias)
  File "C:\Users\nicol\AppData\Local\Programs\Python\Python38-32\lib\site-packages\playsound.py", line 31, in winCommand
    raise PlaysoundException(exceptionMessage)
playsound.PlaysoundException: 
    Error 263 for command:
        open "C:\Tills Vi Dör\tillsvidor" alias playsound_0.9625724469667377
    The specified device is not open or is not recognized by MCI.

为什么会出现此错误?我完全按照他们的pypi页上的说明进行操作。

0 个答案:

没有答案