# Limiting enemy voice sounds

**URL:** https://qa.fmod.com/t/limiting-enemy-voice-sounds/15895
**Category:** Unreal Engine
**Tags:** ue4
**Created:** [June 17, 2020, 5:07pm UTC](https://qa.fmod.com/t/limiting-enemy-voice-sounds/15895 "2020-06-17T17:07:42Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![KeyJay](https://avatars.discourse-cdn.com/v4/letter/k/57b2e6/32.png) [@KeyJay](https://qa.fmod.com/u/KeyJay)
#### Post date: [June 17, 2020, 5:07pm UTC](https://qa.fmod.com/t/limiting-enemy-voice-sounds/15895/1 "2020-06-17T17:07:42Z")

</div>

Hello, I’ve got this situation with which I could use help 🙂

In our RPG game, every enemy has a set of hit reaction, attack and death voice sounds. What I would like is to limit the number of voice sounds playing to 1 for each enemy actor/entity. The reason for that is if the enemy is making a long “heavy attack” roar and during that the player kills it, the creature is doing two voice sounds at one moment.

My half-working solution: All voice sounds are triggered through animations in UE4. So I’ve decided to put all sounds into one event and in each animation, I trigger the correct sound using a parameter _voiceType_. I’ve put all voice sounds in multi instruments underneath each other in one track in Fmod event. Each multi instrument has a _voiceType_ parameter condition to play. In Fmod it works perfectly. If I switch the value of _voiceType_ parameter, the ongoing sound stops and new one starts. In game, it doesn’t work at all. Since all voice sounds are triggered from animations, every time the sound is triggered it creates a new instance of Fmod event.

So I thought - if it would be possible to code a limit of one Fmod instance per one actor in UE4, then this solution might work. (I’m trying to do as much as possible inside Fmod without needing a programmer support, since we’re limited by programmer’s time.)

Do you think that this will work and it is possible to limit instances of Fmod event per actor?  
Or any ideas on how to do it differently?

Thanks guys 🙂

We’re using UE 4.24 and Fmod 2.00.07

---

<div class="post-metadata">

### Author: ![joseph](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/joseph/32/264_2.png) [@joseph](https://qa.fmod.com/u/joseph)
#### Post date: [June 18, 2020, 12:55am UTC](https://qa.fmod.com/t/limiting-enemy-voice-sounds/15895/2 "2020-06-18T00:55:39Z")

</div>

Yes, it is possible to use a single event instance for each character that appears in your game, and to keep that instance alive and re-use it for every sound the character makes.

To do this, you will have to ensure the event instance remains alive at all times (the easiest way to do this in FMOD Studio is to click the “Persistent” toggle button in the event’s macros), and your programmer will have to keep a handle for the event instance in order to send it new commands whenever a new sound is needed, instead of creating a new event instance each time.

As of the time of writing (June of 2020), there is no easy way to limit the event instances associated with a specific game object without using your game’s code unless that game object is guaranteed to be the only one of its type.

---

<div class="post-metadata">

### Author: ![Galenacosti](https://avatars.discourse-cdn.com/v4/letter/g/4491bb/32.png) [@Galenacosti](https://qa.fmod.com/u/Galenacosti)
#### Post date: [June 30, 2020, 5:02pm UTC](https://qa.fmod.com/t/limiting-enemy-voice-sounds/15895/3 "2020-06-30T17:02:00Z")

</div>

Wuood be nice . Meow cap loc puzy

---

<div class="post-metadata">

### Author: ![GiacomoF](https://avatars.discourse-cdn.com/v4/letter/g/e9c0ed/32.png) [@GiacomoF](https://qa.fmod.com/u/GiacomoF)
#### Post date: [November 8, 2022, 11:29pm UTC](https://qa.fmod.com/t/limiting-enemy-voice-sounds/15895/4 "2022-11-08T23:29:49Z")

</div>

as far as I am aware, this hasn’t been addressed yet in the API.  
I do believe it should be more of a priority for the developers since it is something that the competition has been doing already for a very long time.

---

<div class="post-metadata">

### Author: ![joseph](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/joseph/32/264_2.png) [@joseph](https://qa.fmod.com/u/joseph)
#### Post date: [November 9, 2022, 3:39am UTC](https://qa.fmod.com/t/limiting-enemy-voice-sounds/15895/5 "2022-11-09T03:39:26Z")

</div>

> [@GiacomoF](#):
>
> I do believe it should be more of a priority for the developers

I’ve added your name to the list of people interested in this feature.
