Hi, all!

I need store my samples in internal resource (in exe-file). I tried use something like:
[code:2q1gthkc]HRSRC hRes=FindResource(NULL,MAKEINTRESOURCE(resn),"BINARYDATA");
HGLOBAL hgRes=LoadResource(NULL,hRes);
DWORD nSize=SizeofResource(NULL,hRes);
void *pResData=LockResource(hgRes);

sample=FSOUND_Sample_Load(FSOUND_FREE,(const char*)pResData,FSOUND_NORMAL|FSOUND_LOADMEMORY,nSize);[/code:2q1gthkc]

And result is nothing (program startup, checks for loaded samples return true, but nothing sound hear).

Then i search in this forum, and find code to change loading functions (use FSOUND_File_SetCallbacks(memopen, memclose, memread, memseek, memtell); ). I copy that code in my prog. Compiler say:

[code:2q1gthkc]error C2664: ‘FSOUND_File_SetCallbacks’ : cannot convert parameter 1 from ‘unsigned int (char *)’ to ‘unsigned int (__cdecl *)(const char *)’
None of the functions with this name in scope match the target type[/code:2q1gthkc]

Examples compiled normally, my prog – no.

That i can do with this? 8) I have no idea :(

How i can load samples from resource? With loading music i no have problems, only with samples…

  • You must to post comments

Thanks all, who read this thread. I already solve my trouble, but some another way. I use loading song (oxm, for save disk-space) from memory, and place all my sfx into that song.

Thread is closed:)

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.