0
0

Hi there! I am new to FMOD and PPC, and would like to know if anyone knows how to load music files from resources. Any help would be greatly appreciated.

Kind Regards

Amman

  • You must to post comments
0
0

Ok, I’ve got this far with the piece of code.

hrInfo = FindResource(hInstance,MAKEINTRESOURCE(IDR_WAVE),TEXT(“WAVE”));
hr = LoadResource(hInstance, hrInfo);
LPVOID test = LockResource(hr);

The problem now is that the type test is different from the one required in the FSOUND_Sample_Load (which is const char *). If I try to cast the types nothing happens. Can anyone help?

Cheers

Amman

  • You must to post comments
0
0

Ok, after spending the last day sorting this out, I have now come up with this code for any newbie (like me) who is interested.

hrInfo = FindResource(myInstance,MAKEINTRESOURCE(IDR_MUSIC2),_T(“MUSIC”));

hr = LoadResource(myInstance, hrInfo);

hmusic =FSOUND_Sample_Load(FSOUND_FREE, static_cast<const char*>(hr), FSOUND_LOADMEMORY,SizeofResource(myInstance,hrInfo));

FSOUND_PlaySound(FSOUND_FREE,hmusic);

Phew…

Regards

Amman

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.