简体   繁体   中英

Can't play a sound from Python 3

**Hello, I am trying to play a sound in Python, I tried using playsound and other libraries(AudioPlayer,pydub). I use this script for playsound:

from playsound import playsound
playsound('/audio.wav')

I only get this on my computer, do I need something else to be able to play a wav file?

I get this error:** File "C:\ProgramData\Anaconda3\lib\site-packages\playsound.py", line 35, in _playsoundWin winCommand('open "' + sound + '" alias', alias) File "C:\ProgramData\Anaconda3\lib\site-packages\playsound.py", line 30, in winCommand '\n ' + errorBuffer.value.decode()) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 35: invalid continuation byte

Can you share your whole code for more clarification. By the way,

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 35:
invalid continuation byte

you get this error when same or greater amount of bytes or Unicode strings can't be represented in any kind of encoding.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM