Limiting multiple occurrences of the same sound

Hello all. I am creating a tower defense game where, in certain cases, a single sound plays a large number of times at once (for instance, when 30 towers of the same type shoot at once). When this happens, the sounds are (of course) very loud and often cut off, and prevent other sounds from playing, I’m guessing as a result of some limitation on the number of sounds that can happen at once, overloading some buffer, etc.

I could create a system to track the number of times I play a specific sound, and limit it. But I’m wondering if there’s something in the Low Level API that I’m missing - some feature that would do this for me that I’m just not seeing when reading the documentation. I play everything using FMOD_System_PlaySound in the C API, have max channels set to 1024, and Software Channels set to 128.

Apologies for the fairly basic question, and thanks for any pointers or help anyone can provide.


@Alcibiade Thanks for the response - this question is specifically about the Low Level API because I’m using it already in my game - not FMOD Studio.

Yeah, I realized that afterwards :wink:

Check out SoundGroups in the Core API, they might be what you are looking for.

Also, be aware that in addition to Channels (set via Init) and software channels (set via setSoftwareChannels), there are codec limits, set via System::setAdvancedSettings. If you use up all the vorbis codecs for instance, then things will start going virtual.

Thank you! Creating a SoundGroup for each sound, setting it to 2 or 3, and then using BEHAVIOR_STEALLOWEST has seemed to solve the problem. This is exactly what I needed.