# Silence instrument Random chance vs in game random chance

**URL:** <https://qa.fmod.com/t/silence-instrument-random-chance-vs-in-game-random-chance/22195>\
**Category:** FMOD Studio\
**Created:** [October 17, 2024, 5:28pm UTC](https://qa.fmod.com/t/silence-instrument-random-chance-vs-in-game-random-chance/22195 "2024-10-17T17:28:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tlconflict](https://avatars.discourse-cdn.com/v4/letter/t/4491bb/32.png) [@tlconflict](https://qa.fmod.com/u/tlconflict)\
**Post date:** [October 17, 2024, 5:28pm UTC](https://qa.fmod.com/t/silence-instrument-random-chance-vs-in-game-random-chance/22195/1 "2024-10-17T17:28:46Z")

</div>

So when you have sound effects that should have a random chance of not triggering at all, should you use a multi instrument with silence percent set or do it ingame code, e.g

```js
if (random_chance(0.3)) { play_event(sound_id)); }

```

Is there a perf penalty to relying on fmod silence instrument to do the work? Say 100 oneshot sounds per frame or so?

---

<div class="post-metadata">

**Author:** ![li\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/li_fmod/32/6577_2.png) [@li\_fmod](https://qa.fmod.com/u/li_fmod)\
**Post date:** [October 18, 2024, 4:24am UTC](https://qa.fmod.com/t/silence-instrument-random-chance-vs-in-game-random-chance/22195/2 "2024-10-18T04:24:46Z")

</div>

Hi,

Thank you for sharing the information.

> [@tlconflict](#):
>
> Is there a perf penalty to relying on fmod silence instrument to do the work? Say 100 oneshot sounds per frame or so?

For 100 one-shots per frame, the performance impact of this is generally minimal since FMOD is optimized for such tasks.

If you are handling an extreme amount of sounds(e.g. Thousands of sounds per frame), using your own game logic to randomize the playback will have a better performance as it doesn’t need to create an event instance or run any internal logic when the sound is skipped. Please note that you won’t be able to adjust the chance via live update though.

You could monitor performance with [FMOD Studio | profiler 12. Profiling](https://www.fmod.com/docs/2.02/studio/profiling.html) to see how much overhead it introduces compared to your in-game code.

For more information about dealing with large amount of sounds at once, you could also have a look at [FMOD Engine | 5. White Papers | Virtual Voices](https://fmod.com/docs/2.02/api/white-papers-virtual-voices.html).

Hope this helps, let me know if you have any questions.
