Hi! I've almost port a game to scaleform but when profiling and debugging it I've seen that the game sounds are not being streammed. The function:
SoundRendererFMODImpl::CreateSampleFromFile(const char* fname, bool streaming)
is always receiving the 'streaming' parameter as false. My question is, Do I have to do something "special" to use this feature? Right now I'm still using a trial license. Is it neccesary to have an official license to activate the streaming? Obviously, I can edit the code and ignore this parameter, but I not sure about the consequences.
Thanks in advance!
Solved! Go to Solution.
Solved by dani_mrquez. Go to Solution.
It turned out it wasn't so difficult. Reading fmod documentation pointed me the necessary flags to create an streamed buffer.
SoundSampleFMODImpl* SoundRendererFMODImpl::CreateSampleFromFile(const char* fname, bool streaming) { SoundSampleFMODImpl* psample = NULL; { Lock::Locker lock(&SampleListLock); psample = SF_NEW SoundSampleFMODImpl(this); } FMOD_MODE flags = FMOD_SOFTWARE | FMOD_LOOP_NORMAL | FMOD_2D | FMOD_CREATESTREAM;// FMOD_LOOP_NORMAL is not necessary, I just needed it too. You can leave FMOD_LOOP_OFF #if defined(SF_OS_WINMETRO) flags |= FMOD_NONBLOCKING; #endif FMOD_RESULT result; if (streaming) { result = pDevice->createStream(fname, flags, NULL, &(psample->pSound)); } else result = pDevice->createSound(fname, flags, NULL, &(psample->pSound)); if (result != FMOD_OK) { LogError(result); psample->pSound = NULL; psample->Release(); return NULL; } return psample; }
FMod doesn't create streamed sounds by default, so you need to use:
FMOD_CREATESTREAM