0

我编写了一个在 Ubuntu 上完美运行但在 Windows 上无法运行的代码。这是代码:

from playsound import playsound

playsound("sound")

和错误:

Traceback (most recent call last):
  File "test.py", line 3, in <module>
    playsound("sound")
  File "D:\Programmes\Miniconda3\envs\marmodio\lib\site-packages\playsound.py", line 35, in _playsoundWin
    winCommand('open "' + sound + '" alias', alias)
  File "D:\Programmes\Miniconda3\envs\marmodio\lib\site-packages\playsound.py", line 30, in winCommand
    '\n    ' + errorBuffer.value.decode())
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 4: invalid continuation byte

为什么 Ubuntu 和 Windows 之间存在差异,我该如何解决?

4

1 回答 1

1

它说文件是健全的,但它需要类似于 sound.mp3

于 2020-07-08T13:43:33.490 回答