0

I am trying to play some 40 second commentary when a certain object is clicked, but each time I click it, the windows error sound plays.

    import winsound
    winsound.PlaySound('PED.wav', winsound.SND_FILENAME)

I have a shorter file which works so it must be something to do with the length of the file. It is also in the same folder as my python program.

Another solution said that it works if you put you put the .wav file in the python directory but I'm not sure which folder to put it in.

Thanks.

  • Can you post the WAV file somewhere? I can probably take a look to see what's malformed about it. Have you tried passing the full path to the filename instead to the PlaySound call? (e.g. `winsound.PlaySound("c:/users/bob/PED.wav", winsound.SND_FILENAME)` ) – selbie Feb 28 '18 at 16:42
  • Hi thanks for the response. I tried that but it still didn't work. I have found a way around it though by using mixer. – Cameron Lievesley Feb 28 '18 at 16:47

0 Answers0