Async sound loading? Instantly?

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? :frowning:

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));

Everyone ignoring, lol. Btw looks like i did something and it works. Thanks, lmao…

What is the problem you are encountering?

Streaming sounds will decompress them at runtime and can only be played once at a time due to a stream only having 1 stream buffer and file handle.

https://fmod.com/resources/documentation-api?version=2.1&page=core-guide.html#streaming-settings