Hey guys,
I’m getting a crash attempting to create a sound with in-memory data:
FMOD_CREATESOUNDEXINFO createSoundEXInfo;
memset(&createSoundEXInfo, 0, sizeof(FMOD_CREATESOUNDEXINFO));
createSoundEXInfo.cbsize = sizeof(FMOD_CREATESOUNDEXINFO);
createSoundEXInfo.length = uiSampleLen - uiOffset;
createSoundEXInfo.numchannels = 1;
createSoundEXInfo.defaultfrequency = 11025;
createSoundEXInfo.format = FMOD_SOUND_FORMAT_PCM8;
createSoundEXInfo.suggestedsoundtype = FMOD_SOUND_TYPE_RAW;
const char *pSoundData = (const char *)(ptr + uiOffset);
int iFlags = FMOD_2D | FMOD_OPENMEMORY;
if (bLoop)
{
iFlags |= FMOD_LOOP_NORMAL;
}
FMOD_RESULT result = mp_pFMODStudioCoreSystem->createSound(pOffsetSoundData, iFlags, &createSoundEXInfo, &mp_pSound);
Am I missing parameters to the FMOD_CREATESOUNDEXINFO structure? The sound data is correct 8-bit PCM, mono 11.025 kHz data, etc.
Call stack (probably not helpful):
FMOD::SystemI::createSoundInternal (0x8190ACC)
FMOD::SystemI::createSound (0x810BEF8)
FMOD::System::createSound (0x8105798)
It’s corrupting the stack.
Here’s the logged output:
[LOG] SystemI::createSoundInternal : Create data=0x20944f7388, mode=0x00000808
[LOG] SystemI::createSoundInternal : exinfo->cbsize = 224
[LOG] SystemI::createSoundInternal : exinfo->length = 41154
[LOG] SystemI::createSoundInternal : exinfo->numchannels = 1
[LOG] SystemI::createSoundInternal : exinfo->defaultfrequency = 11025
[LOG] SystemI::createSoundInternal : exinfo->format = 1
[LOG] SystemI::createSoundInternal : exinfo->suggestedsoundtype = 12
[ERR] CodecOggVorbis::openInternal : failed to open as ogg
[ERR] CodecMOD::openInternal : 'M.K.' etc ID check failed [■■■■]
[ERR] CodecS3M::openInternal : 'SCRM' ID check failed [■■■■]
[ERR] CodecXM::openInternal : 'Extended Module: ' ID check failed [■■■■]
[ERR] CodecIT::openInternal : 'IMPM' etc ID check failed [■■■■]
[ERR] CodecMIDI::openInternal : 'HThd' ID check failed [■■■■]
… it crashes here.
Shouldn’t the suggestedSoundType
variable make FMOD open the data as RAW PCM data?
This is on version 0x00020011.
Matt