# Cannot change volume or pitch before playing sound

**URL:** <https://qa.fmod.com/t/cannot-change-volume-or-pitch-before-playing-sound/16304>\
**Category:** Unity\
**Created:** [October 15, 2020, 7:07pm UTC](https://qa.fmod.com/t/cannot-change-volume-or-pitch-before-playing-sound/16304 "2020-10-15T19:07:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ull1s](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/ull1s/32/1615_2.png) [@ull1s](https://qa.fmod.com/u/ull1s)\
**Post date:** [October 15, 2020, 7:07pm UTC](https://qa.fmod.com/t/cannot-change-volume-or-pitch-before-playing-sound/16304/1 "2020-10-15T19:07:14Z")

</div>

I’m using the follow code, calling the function with a public studioeventemitter as sound. Everything works fine, except that the " sound.EventInstance.setPitch(pitch);" and " sound.EventInstance.setVolume(volume);" doesn’t do anything. I’ve tried setting them on start, after instantiation etc and nothing works. does anyone know what I’ve done wrong?

```
public void InstantiateSound(StudioEventEmitter sound, Vector3 pos, float pitch, float volume)
 {
    sound.EventInstance.setPitch(pitch);

sound.EventInstance.setVolume(volume);

Instantiate(sound, pos, Quaternion.identity);

 }
```

---

<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:** [October 22, 2020, 5:32am UTC](https://qa.fmod.com/t/cannot-change-volume-or-pitch-before-playing-sound/16304/2 "2020-10-22T05:32:50Z")

</div>

The FMOD functions, like setPitch and setVolume, should return an `FMOD.RESULT` which could tell you if they are silently failing.
