1

I am trying to make a simple metronome in Python using the playsound module. But when I run it, there's the following error:

Traceback (most recent call last):   
  File "/run/media/mb/Volume/Dokumente/Coding/Python/Metronom/metronom.py", line 5, in <module>
    playsound("Cowbell.wav")   
  File "/usr/lib/python3.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>
Tomerikoo
  • 18,379
  • 16
  • 47
  • 61

1 Answers1

-3
#if its in the same folder as project
playsound('file.mp3')
#somewhere else? then full path (REMEMBER PYTHON USES FORWARDSLASHES /, NOT BACKSLASHES \)
playsound('C:/your/path/to/file.mp3')

Also be aware that some files will throw a playsound exception if they have a high enough bitrate (idk why, i suppose playsound cant handle some high quality bitrates)

Matterhorn
  • 45
  • 3