THE WHYTELEAFE FC SUPPORTERS' DISCUSSION FORUM

WHYTELEAFE FC HOMEPAGE | WHYTELEAFE FC FACEBOOK PAGE | WHYTELEAFE FC TWITTER

NOTE: All postings from persons calling themselves "Anonymous", "anon" or similar will be deleted

Return to front page

Newest article: Re: Barber Beauty Supplies by CarterToday 09:59Today at 09:59:46view thread

Oldest article: Opening hours by WFC2/12/2014 17:09Tue Dec 2 17:09:32 2014view thread

MenuSearch

Next thread: How much does a MVP development cost? by soniak21/6 14:13Tue Jun 21 14:13:14 2022view thread

PlaySound() mmslib does not play existing sound

By Ogburn6521/10/2021 10:13Fri Oct 1 10:13:04 2021

Views: 124

EDIT: Solved. Simply the .wav file was not accepted by Windows. I plucked one of Windows own files and renamed it to what my previous file was called and it plays without problem.

I don't know why this can't play the existing file. Windows gives a chime in that something is wrong but I have no clue what.

I added a check right before to make sure it exists. I have also tried absolute paths.

string wavPath = "c:\\frog.wav";

struct stat stFileInfo;
bool blnReturn = (stat(wavPath.c_str(), &stFileInfo) == 0); //this returns true

FILE* fp = fopen(wavPath.c_str(), "r");
if (fp) {
fclose(fp); //this triggers
}

PlaySound(wavPath.c_str(), NULL, SND_FILENAME | SND_ASYNC); //m_hinstance
//C:\\Users\\Wollan\\My Code\\A\\Debug\\frog.wav
//TEXT("frog.wav")
//TEXT(wavPath.c_str())
//(LPCSTR)"frog.wavยจ
The file plays fine in WMP.

MyMileStoneCard

reply to this article | return to the front page

Re: PlaySound() mmslib does not play existing sound

By oscarmoc21/6 13:59Tue Jun 21 13:59:39 2022In response to PlaySound() mmslib does not play existing soundTop of thread

Views: 11

Such a beautiful journey!! You have shared your story that anyone would think they were writing the book themselves. Really inspiring!! Wishing you more and more success.๐Ÿš€๐Ÿš€


https://mymilestonecard.xyz/

reply to this article | return to the front page

Previous thread: Hey! What do you think about decorations for the holidays? How often do you make holiday decorations for your business o by Annade327/4 17:24Wed Apr 27 17:24:36 2022view thread

Follow us on Twitter @WhyteleafeFC. Visit the Twitter page for the full picture.