TaylorSMarks / playsound

Pure Python, cross platform, single function module with no dependencies for playing sounds.
Other
502 stars 118 forks source link

Error when trying to play a sound, <enum GST_STATE_CHANGE_FAILURE of type Gst.StateChangeReturn> #17

Open SinclairHudson opened 6 years ago

SinclairHudson commented 6 years ago

I'm running ubuntu 16.04 off of a USB stick, and I'm getting the following error when I try to play a .wav file. Traceback (most recent call last): File "/media/sinclair/SINCLESTORE/JUNO/labelling.py", line 19, in playsound("/SINCLESTORE/JUNO/"+audio_path) File "/home/sinclair/.local/lib/python3.5/site-packages/playsound.py", line 106, in _playsoundNix "playbin.set_state returned " + repr(set_result)) playsound.PlaysoundException: playbin.set_state returned not sure what this means. Do I have to change something about my speaker configuration?

Thanks, Sinclair

seanspotatobusiness commented 6 years ago

I get the same error using playsound in my script and it's intermittent; I don't get it every time. I have no idea what it means and probably little chance of figuring it out but I will report back if do.

Traceback (most recent call last): File "/home/pi/Mining/AltexNotificationScript_Sean.py", line 22, in playsound('DEFCON enemy launch.mp3') File "/home/pi/.local/lib/python2.7/site-packages/playsound.py", line 106, in _playsoundNix "playbin.set_state returned " + repr(set_result)) playsound.PlaysoundException: playbin.set_state returned < enum GST_STATE_CHANGE_FAILURE of type Gst.StateChangeReturn >

Edit: I added spaces before and after the < > symbols because otherwise the contents of those brackets were hidden.

xPTM1219 commented 4 years ago

I know the post is old but, just in case when this error occurred to me it was because the name of the sound was not written correct. Also you could add a try/except and this way the troubleshoot is easier.

mwaa123 commented 4 years ago

Hi, i have this error ,what can i do?Am trying to put audios in my python file.I am using flask

TheTechRobo commented 3 years ago

for me it was that the file didn't exist

Ubuntufanboy commented 2 years ago

I know this post is old but I have a solution. You need to remove the ", True" tag at the end of the line. If that doesent work than make sure the file exists with "find" command