# Change volume StudioEventEmitter

**URL:** <https://qa.fmod.com/t/change-volume-studioeventemitter/20269>\
**Category:** Unity\
**Created:** [June 1, 2023, 9:12am UTC](https://qa.fmod.com/t/change-volume-studioeventemitter/20269 "2023-06-01T09:12:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarsLit](https://avatars.discourse-cdn.com/v4/letter/m/7993a0/32.png) [@MarsLit](https://qa.fmod.com/u/MarsLit)\
**Post date:** [June 1, 2023, 9:12am UTC](https://qa.fmod.com/t/change-volume-studioeventemitter/20269/1 "2023-06-01T09:12:44Z")

</div>

Hi,  
Is possible to change thr volume of an emitter or it can only be done using FMOD?

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [June 4, 2023, 10:59pm UTC](https://qa.fmod.com/t/change-volume-studioeventemitter/20269/2 "2023-06-04T22:59:46Z")

</div>

Hi,

What version of FMOD are you using? Could you elaborate on how you want to change the volume? Via code or by another means.

If you have a reference to the event emitter you can change its volume by using EventInstance::setVolume() ([FMOD API | Studio API - Studio::EventInstance](https://fmod.com/docs/2.02/api/studio-api-eventinstance.html#studio_eventinstance_setvolume)).

Hope this helps!

---

<div class="post-metadata">

**Author:** ![MarsLit](https://avatars.discourse-cdn.com/v4/letter/m/7993a0/32.png) [@MarsLit](https://qa.fmod.com/u/MarsLit)\
**Post date:** [July 14, 2023, 3:35pm UTC](https://qa.fmod.com/t/change-volume-studioeventemitter/20269/3 "2023-07-14T15:35:08Z")

</div>

Sorry for my late reply.  
Is this code right or I’m missing something?

```auto

            sfxOnHit.EventInstance.setVolume(0.5f);
            sfxOnHit.Play();

```

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [July 18, 2023, 12:47am UTC](https://qa.fmod.com/t/change-volume-studioeventemitter/20269/4 "2023-07-18T00:47:55Z")

</div>

Hi,

An `Event Instance` won’t be valid until it is created and played. In your example, the `setVolume()` function will return `ERR_INVALID_HANDLE`, full error explanations can be found here: [FMOD Engine | Core API Reference - Common](https://fmod.com/docs/2.02/api/core-api-common.html#fmod_result), letting us know the `Event Instance` hasn’t been created yet. Try playing the `Emitter` before you change the volume of its `Evnet Instance`, and you can check the `Event Instance` is ready to be interacted with by using `sfxOnHit.EventInstance.isValid()` which returns a bool.

Hope this helps!
