Search code examples
pythonaudio

Winsound not working isn't working at all


I'm making a quick draft for a project I'm doing and I can't seem to get winsound module to work. Well the module would load no yellow error line, and won't tell me that it doesn't exist. It even does the rest of the lines opening up the browser. But the audio doesn't play,


          if messagebox.showerror(title="*ANGRY*", message="ALRIGHT THIS IS WHAT YOU GET!!!"):
                 if messagebox.showerror(title="sus", message="MY SUPER LASER PISS!!!!!!!!!!!!!!!!!!!!!!!!"):
                        for i in range(1):
                               winsound.PlaySound('SUPERLASERPISS.mp3', winsound.SND_FILENAME)
                               webbrowser.open("https://www.bing.com/images/search?q=PISS&form=HDRSC3&first=1")

I used "SND_FILENAME" instead of 0 to see if that would fix ti but it wouldnt.

I expected it to play the sound, end of story. (and also open up 100 tabs of eggman but that's not the point) It won't play.


Solution

  • The problem in your code is that winsound accepts .wav files, not .mp3. You can use any online converter to convert your .mp3 audio file to .wav. Then, it should work.

    (I have to admit, I didn't expect such a content for strings here 0_0)