I dont really know where to contact with you, so…
Hi there! Adding FMOD to my “game” (Source Engine mod).
Trying to apply FMOD engine to shooting sounds. As i understood, FMOD’s createStream has a queue of file loading. That’s why i got sound “stopping” and playing like in a queue (waiting for the same sound to end).
Using FMOD_NONBLOCKING - it looks weird. What is it doing? Is it really good to use it with createStream + FMOD_NONBLOCKING + loop until ot became ready?
UPD: Added a little delay (~50ms), it seems like sounds are better now. What’s going on?
P.S. Shooting sounds still weird and “disappearing” sometimes.
P.P.S. Code example:
if(CFMODManager::CheckError(GetFMODManager()->GetSystem()->createStream(szSound, FMOD_2D | FMOD_NONBLOCKING, 0, &pSound)) != FMOD_OK)
return;
FMOD_RESULT result;
FMOD_OPENSTATE state;
FMOD::Channel* pChannel = nullptr;
do
{
result = pSound->getOpenState(&state, 0, 0, 0);
if (state == FMOD_OPENSTATE_READY && !pChannel)
{
result = GetFMODManager()->GetSystem()->playSound(pSound, GetFMODManager()->GetChannelGroup(CHANNELGROUP_SOUNDS), true, &pChannel);
break;
}
else if (state == FMOD_OPENSTATE_ERROR)
return;
} while (1);
CFMODManager::CheckError(pChannel->setVolume(flVolume));
CFMODManager::CheckError(pChannel->setPitch(1.0f));
CFMODManager::CheckError(pChannel->setPaused(false));