# Play different sounds through 1 Event Emitter?

**URL:** <https://qa.fmod.com/t/play-different-sounds-through-1-event-emitter/16885>\
**Category:** Unity\
**Created:** [March 15, 2021, 2:27pm UTC](https://qa.fmod.com/t/play-different-sounds-through-1-event-emitter/16885 "2021-03-15T14:27:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bengel2004](https://avatars.discourse-cdn.com/v4/letter/b/74df32/32.png) [@bengel2004](https://qa.fmod.com/u/bengel2004)\
**Post date:** [March 15, 2021, 2:27pm UTC](https://qa.fmod.com/t/play-different-sounds-through-1-event-emitter/16885/1 "2021-03-15T14:27:10Z")

</div>

Hey Everyone! I’m switching from unity’s main System to Fmods new Audio system for the 1st time! And I’m trying to implement audio for my player.

My player has 1 audio source in which I intend to play different weapon sounds (pistol, rifle, shotgun etc) based on which weapon the player is holding. Though when I play 1 rifle sound and then try to switch that sound event to for instance pistol, it won’t work and still plays the rifle.

How can I tell Unity which audio to play and how to do make 1 Studio Event Emitter play different audio types such as rifle, shotgun etc depending on which gun the player is holding?

---

<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:** [March 15, 2021, 3:38pm UTC](https://qa.fmod.com/t/play-different-sounds-through-1-event-emitter/16885/2 "2021-03-15T15:38:06Z")

</div>

Hi!  
The most simple way is probably by using a parameter which will handle the weapon type. Haven’t you tried that?

---

<div class="post-metadata">

**Author:** ![bengel2004](https://avatars.discourse-cdn.com/v4/letter/b/74df32/32.png) [@bengel2004](https://qa.fmod.com/u/bengel2004)\
**Post date:** [March 15, 2021, 5:18pm UTC](https://qa.fmod.com/t/play-different-sounds-through-1-event-emitter/16885/4 "2021-03-15T17:18:03Z")

</div>

Is there a possible guide I can check out on how that would work? I only see things where you fade audio with the parameter but not sure how to combine that for like 10 weapons or more? Can I swap easily with that system?

EDIT: It also needs to be able to be a different value for different objects, so if Player 1 uses a rifle and Player 2 uses a pistol, both audio should be according to the weapon.

---

<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:** [March 15, 2021, 6:54pm UTC](https://qa.fmod.com/t/play-different-sounds-through-1-event-emitter/16885/5 "2021-03-15T18:54:01Z")

</div>

Open the Exemples project, then open Character/Player Footsteps event. Play the event while changing the “Surface” parameter value. I guess you need something equivalent to that, with “Weapon” instead, isn’t it? Instead of a timeline sheet, this event uses a parameter sheet (that you can create with the “+” tab).  
So that each instance have a different parameter value, the parameter should be set to “Local” (but it’s the default setting).

---

<div class="post-metadata">

**Author:** ![bengel2004](https://avatars.discourse-cdn.com/v4/letter/b/74df32/32.png) [@bengel2004](https://qa.fmod.com/u/bengel2004)\
**Post date:** [March 16, 2021, 12:23am UTC](https://qa.fmod.com/t/play-different-sounds-through-1-event-emitter/16885/6 "2021-03-16T00:23:09Z")

</div>

Thank you so much for your amazing answer! I will give everything a shot and see how it works out, thank you so much!! 😃

---

<div class="post-metadata">

**Author:** ![bengel2004](https://avatars.discourse-cdn.com/v4/letter/b/74df32/32.png) [@bengel2004](https://qa.fmod.com/u/bengel2004)\
**Post date:** [March 16, 2021, 7:43pm UTC](https://qa.fmod.com/t/play-different-sounds-through-1-event-emitter/16885/7 "2021-03-16T19:43:12Z")

</div>

When I try to set the parameters so, a double value plays. Do you have any idea what could cause that?

More explained here if you don’t mind checking 🙂

> [@FMOD Label parameter plays previous and current value?](https://qa.fmod.com/t/fmod-label-parameter-plays-previous-and-current-value/16888):
>
> When I try to play audio type 1 in unity, type 0 is also played, and type 1. So you hear both play at the same time through one event emitter. This is my fmod. This is my code [image] How do I get it so that only the correct weapon shoots instead of the ones before in the array range? So instead of sound 0 and 1 playing, just play sound 1 and ignore sound 0 because the value is on sound 1? P.S In the inspector everything works fine, if I play 1 I only hear the rifle, but in the g…
