# Limiting multiple occurrences of the same sound

**URL:** <https://qa.fmod.com/t/limiting-multiple-occurrences-of-the-same-sound/17952>\
**Category:** FMOD Engine\
**Created:** [November 12, 2021, 7:14pm UTC](https://qa.fmod.com/t/limiting-multiple-occurrences-of-the-same-sound/17952 "2021-11-12T19:14:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![svernk](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@svernk](https://qa.fmod.com/u/svernk)\
**Post date:** [November 12, 2021, 7:14pm UTC](https://qa.fmod.com/t/limiting-multiple-occurrences-of-the-same-sound/17952/1 "2021-11-12T19:14:34Z")

</div>

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.

Svern

---

<div class="post-metadata">

**Author:** ![svernk](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@svernk](https://qa.fmod.com/u/svernk)\
**Post date:** [November 12, 2021, 9:37pm UTC](https://qa.fmod.com/t/limiting-multiple-occurrences-of-the-same-sound/17952/3 "2021-11-12T21:37:46Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![Alcibiade](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/alcibiade/32/4284_2.png) [@Alcibiade](https://qa.fmod.com/u/Alcibiade)\
**Post date:** [November 12, 2021, 9:38pm UTC](https://qa.fmod.com/t/limiting-multiple-occurrences-of-the-same-sound/17952/4 "2021-11-12T21:38:46Z")

</div>

Yeah, I realized that afterwards 😉

---

<div class="post-metadata">

**Author:** ![mathew](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/mathew/32/431_2.png) [@mathew](https://qa.fmod.com/u/mathew)\
**Post date:** [November 14, 2021, 10:03pm UTC](https://qa.fmod.com/t/limiting-multiple-occurrences-of-the-same-sound/17952/5 "2021-11-14T22:03:02Z")

</div>

Check out [SoundGroups](https://fmod.com/resources/documentation-api?version=2.02&page=core-api-soundgroup.html) 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.

---

<div class="post-metadata">

**Author:** ![svernk](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@svernk](https://qa.fmod.com/u/svernk)\
**Post date:** [November 15, 2021, 4:30pm UTC](https://qa.fmod.com/t/limiting-multiple-occurrences-of-the-same-sound/17952/6 "2021-11-15T16:30:37Z")

</div>

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.
