In C, my PlaySound
is not throwing any errors... but instead of playing the file I want, it just beeps.
Any suggestions?
I tried :
PlaySound("song1.wav", NULL, SND_ALIAS | SND_APPLICATION);
And:
PlaySound("song1.wav", NULL, SND_FILENAME);
But I got the same result.
Instead of using relative path like you have done:
Use an absolute path like:
Quote from PlaySound API description, at msdn.microsoft.com:
So, add the file directory path into the
PATH
environment variable in windows. That should fix your issue.I was in trouble with same situation like OP's and found solution for me. My solution is eliminating meta data of wav file.
Post (japanese)
Referring to post, PlaySound() API can't play some wav files that are exported with famous audio tool. (such as ProTools, CUBASE, StudioOne etc..)
And eliminating meta data makes it worked. in blog post, he opened some 'troubling' wave file with SoundEngine(japanese) and just 'save as' new file to eliminate wav RIFF meta information.