visual c++ - FMOD API - Can't load sound from memory -


int main(int arg, char *args[]) { fmod::system *system; fmod::sound *sound; fmod::channel *channel = 0; fmod_createsoundexinfo exinfo; fmod_result result; void *buffer = 0; int key; zipentry ze; hzip hz = openzip("c:\\users\\lukas\\desktop\\music.pak", ""); findzipitem(hz, "recording 1.mp3", true, null, &ze); buffer = malloc(ze.unc_size); unzipitem(hz, ze.index, buffer, ze.unc_size); closezip(hz);  zeromemory(&exinfo, sizeof(fmod_createsoundexinfo)); exinfo.cbsize = sizeof(fmod_createsoundexinfo); exinfo.length = ze.unc_size; result = fmod::system_create(&system); result = system->init(32, fmod_init_normal, 0); result = system->createsound((const char*)buffer, fmod_hardware | fmod_openmemory, &exinfo, &sound); result = system->playsound(fmod_channel_free, sound, false, &channel); while(true) {     if(_kbhit())     {         key = _getch();         if(key == 27)break;     } } sound->release(); system->close(); system->release(); return 0; } 

sound loaded memory correctly. have problem system->createsound() function. throws fmod_invalid_parram should okay. (compared fmod examples) answers.

everything okay forgot copy dll file^^


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

.htaccess - Matching full URL in RewriteCond -