I’ve been trying to solve this issues for a couple of days now without any luck.
The end code would load a single sound pak which contains 30 odd sounds all of the same type (i.e. frequency, channels and format). I’ve removed the header of each of the sounds and store just one version at the start of the pak. I then use FMOD_CREATESOUNDEXINFO to fill in the missing information.
The code below is from the loadfrommemory example for ease of use.
LoadFileIntoMemory("../media/sound01.wav", &buff, &length);
memset(&exinfo, 0, sizeof(FMOD_CREATESOUNDEXINFO));
exinfo.cbsize = sizeof(FMOD_CREATESOUNDEXINFO);
exinfo.length = length;
exinfo.defaultfrequency = 22050;
exinfo.numchannels = 1;
exinfo.format = FMOD_SOUND_FORMAT_PCM16;
exinfo.suggestedsoundtype = FMOD_SOUND_TYPE_WAV;
exinfo.fileoffset = 44;
result = system->createSound((const char *)buff, FMOD_HARDWARE | FMOD_OPENMEMORY, &exinfo, &sound1); ERRCHECK(result);
I load the file into memory, set the struct FMOD_CREATESOUNDEXINFO with the relevant information using the fileoffset to skip the header (That is what I assume it does). From my understanding, FMOD should use the information from FMOD_CREATESOUNDEXINFO as a replacement header but I get an error code (25) FMOD_ERR_FORMAT (Unsupported file or audio format)
Has anyone else had this problem? or can anyone see where I’m going wrong?
Thanks in advance.
- RickyC asked 8 years ago
- You must login to post comments