When I Use FMOD_NONBLOCKING Flag To Create Steam Sound,Call Releasesound Function cost long time

Hello Guys
Use FMOD_NONBLOCKING Flag To Create Steam Sound Duration 25s,when The Sound Openstate is FMOD_OPENSTATE_PLAYING I Call ReleaseSound to destroy it, ReleaseSound process stalling the main thread about 8ms,what can i do to avoid ReleaseSound talling the main thread?why does releasesound take so much time?@cameron-fmod

If the Stream is FMOD_OPENSTATE_PLAYING, the Sound::release call must wait until the stream thread has finished its current update pass before the stream can be safely released. To avoid any stall make sure you stop the stream first.

Hi mathew
Thank you reply ,I will judge whether the current state of sound is FMOD_OPENSTATE_READY If not, stop first and wait for FMOD_OPENSTATE_READY Release again, but there is a huge problem of thread consumption. What is the thread doing? Why is it consuming so much? There were about 50 sound in the system at that time.

To get some more information about how much CPU is being used by streaming, consider using System::getCPUUsage. If you have a lot of streaming content, consider loading some as FMOD_CREATECOMPRESSEDSAMPLE.