Python Playsound UnicodeDecodeError while playing sound

1.4k Views Asked by At

I wrote a code that works perfectly on Ubuntu but not working on Windows. Here's the code :

from playsound import playsound

playsound("sound")

And the error :

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

Why is there a difference between Ubuntu and Windows and how can I fix it?

1

There are 1 best solutions below

0
On BEST ANSWER

it says the file is sound but it needs to be something like sound.mp3