# Lots of sounds makes the game go mute? (Unity)

**URL:** https://qa.fmod.com/t/lots-of-sounds-makes-the-game-go-mute-unity/17971
**Category:** Unity
**Created:** [November 15, 2021, 10:32pm UTC](https://qa.fmod.com/t/lots-of-sounds-makes-the-game-go-mute-unity/17971 "2021-11-15T22:32:30Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Byproduct](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/byproduct/32/2873_2.png) [@Byproduct](https://qa.fmod.com/u/Byproduct)
#### Post date: [November 15, 2021, 10:32pm UTC](https://qa.fmod.com/t/lots-of-sounds-makes-the-game-go-mute-unity/17971/1 "2021-11-15T22:32:30Z")

</div>

Hello! I’m new to FMOD, just integrated it into a Unity project where I have lots of short sounds playing (think machine guns and stuff like that). I play the sounds via script using `FMODUnity.RuntimeManager.PlayOneShot(eventname, transform.position);`

When I play it in the unity editor, some sounds are intermittently missing, as if there isn’t enough sound channels. (The debug window says it uses 20-40 channels.)  
When I run the game as an executable, the sounds play for a couple of seconds, then go completely mute for several seconds, then _really_ struggle, playing just one or two sounds every now and then.

I’m not sure what’s going on. Am I running out of sound channels, or is something else happening? If it’s the lack of channels, how do I increase them? I’ve found some commands like  
`FMODUnity.RuntimeManager.CoreSystem.setSoftwareChannels(128);`  
…but I don’t know how to use them. If I try adding them in just somewhere in my scripts, nothing seems to change.

Could someone tell me how to increase sound channels in FMOD/Unity? I mean in a very practical way, which line of code to add, or which settings to tweak?

The sound works fine without FMOD. (I’d like to add FMOD for some added features though.)

---

<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 15, 2021, 11:15pm UTC](https://qa.fmod.com/t/lots-of-sounds-makes-the-game-go-mute-unity/17971/2 "2021-11-15T23:15:31Z")

</div>

I can’t really answer for the max channel and Unity part, but for the FMOD Studio part, did you work a bit on limiting the number of instances? You can limit on a per event basis, per bus basis, or even on the master, with the most appropriate stealing mode. For lots of short sounds spamming in a row, maybe think of setting a short cooldown in the macros. And I hope you didn’t set your assets as “streaming”.

---

<div class="post-metadata">

### Author: ![Byproduct](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/byproduct/32/2873_2.png) [@Byproduct](https://qa.fmod.com/u/Byproduct)
#### Post date: [November 16, 2021, 7:22am UTC](https://qa.fmod.com/t/lots-of-sounds-makes-the-game-go-mute-unity/17971/3 "2021-11-16T07:22:17Z")

</div>

Heya, thanks for replying!

The number of instances is already limited in my game itself (and the sound works fine without FMOD), and the assets are not set as streaming.

---

<div class="post-metadata">

### Author: ![Byproduct](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/byproduct/32/2873_2.png) [@Byproduct](https://qa.fmod.com/u/Byproduct)
#### Post date: [November 16, 2021, 11:41am UTC](https://qa.fmod.com/t/lots-of-sounds-makes-the-game-go-mute-unity/17971/4 "2021-11-16T11:41:37Z")

</div>

I’ve tried adding these lines to a script:  
`FMODUnity.RuntimeManager.CoreSystem.setSoftwareChannels(128);`  
`FMOD.ADVANCEDSETTINGS advset = new FMOD.ADVANCEDSETTINGS();`  
`advset.maxVorbisCodecs = 128;`  
`advset.maxMPEGCodecs = 128;`  
`advset.maxPCMCodecs = 128;`  
`advset.ASIONumChannels = 128;`

…but I’m not sure if that’s the right way at all. It doesn’t seem to help. What else could I try?

I’ve also tried switching between WASAPI and ASIO, tried lowering the game’s CPU usage, and tried lowering the rate at which sounds are played - sounds still get muted a lot. It shouldn’t be this bad, so it feels like the number of channels is very low or some other setting is very wrong by default. Or I’m doing something completely wrong.

---

<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 16, 2021, 12:31pm UTC](https://qa.fmod.com/t/lots-of-sounds-makes-the-game-go-mute-unity/17971/5 "2021-11-16T12:31:57Z")

</div>

Did you try using the profiler and live update, to get more detailed informations?

---

<div class="post-metadata">

### Author: ![Byproduct](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/byproduct/32/2873_2.png) [@Byproduct](https://qa.fmod.com/u/Byproduct)
#### Post date: [November 16, 2021, 10:06pm UTC](https://qa.fmod.com/t/lots-of-sounds-makes-the-game-go-mute-unity/17971/6 "2021-11-16T22:06:55Z")

</div>

Well, I’m just bad at browsing menus it seems! Finally found the solution: two sliders labeled real and virtual channel count.

FMOD top menu → edit settings → “Platform Specific” → “Default” and there they are, four menus deep. The issue was that they default to (only) 32, and the script commands did nothing, but these sliders do the job.
