# Muting a channel / a track from parameters / scripts causes serious cumilative lags

**URL:** <https://qa.fmod.com/t/muting-a-channel-a-track-from-parameters-scripts-causes-serious-cumilative-lags/15631>\
**Category:** Unity\
**Created:** [April 11, 2020, 6:50am UTC](https://qa.fmod.com/t/muting-a-channel-a-track-from-parameters-scripts-causes-serious-cumilative-lags/15631 "2020-04-11T06:50:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![clpsplug](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/clpsplug/32/851_2.png) [@clpsplug](https://qa.fmod.com/u/clpsplug)\
**Post date:** [April 11, 2020, 6:50am UTC](https://qa.fmod.com/t/muting-a-channel-a-track-from-parameters-scripts-causes-serious-cumilative-lags/15631/1 "2020-04-11T06:50:33Z")

</div>

I see a tiny lag when you mute a playing event instance via parameter automation and whenever from scripts using `EventInstance::setVolume(float).`

An event has automation controlled by a continuous parameter on volumes for two out of its three tracks. The tracks will either mute or unmute themselves according to the parameter value.  
Although muted, the three tracks will eventually play at once. The event also has a loop section where all the tracks are playing.

My game currently controls the event in such ways:

1. An increase in a parameter will cause the muted tracks to join in, as stated by the automation.
2. The entire channel ducks when an external sound plays.

Unity integration seems to be having trouble reproducing these effects.

1. When I trigger this event in the FMOD Events tab, it seems to play fine until I increase the parameter; the tracks that join in lags behind. This issue will resolve itself when the event reaches the end of the loop.

2. Each time I mute and resume the channel from code, all the tracks lag (nothing seems to connect at the end of the loop seamlessly.) The effect stacks up until the event loops when all the tracks restart. When this ducking happens a lot within a single iteration, the event will have a severe lag.

I also realized that for the issue 2., you could avoid the problem by setting the volume to a small value like `0.01f.` I haven’t tested it yet, but it might also be possible to avoid issue 1. by allowing the track to be barely audible (like -75dB.)

Are these the only way to work around this problem?  
I’m using FMOD 2.01.00 with Unity 2019.3.4.f1.

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [April 21, 2020, 12:19am UTC](https://qa.fmod.com/t/muting-a-channel-a-track-from-parameters-scripts-causes-serious-cumilative-lags/15631/2 "2020-04-21T00:19:21Z")

</div>

You should be able to set the [Priority](https://www.fmod.com/resources/documentation-studio?version=2.1&page=event-macro-controls-reference.html#priority) property to high or highest to work around that type of issue. This makes sure that the instruments are loaded and ready to go before they are triggered/unmuted.

---

<div class="post-metadata">

**Author:** ![clpsplug](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/clpsplug/32/851_2.png) [@clpsplug](https://qa.fmod.com/u/clpsplug)\
**Post date:** [April 30, 2020, 4:52pm UTC](https://qa.fmod.com/t/muting-a-channel-a-track-from-parameters-scripts-causes-serious-cumilative-lags/15631/3 "2020-04-30T16:52:06Z")

</div>

Thanks for the reply - that worked. I needed to set the priority to ‘Highest’ - ‘High’ did the trick for the preview in the editor but wasn’t quite enough for Play Mode.
