Failing to manipulate StudioEventEmitter volume

Hi!

I’ve been trying to make a mod for a game where I allow the user to adjust volumes of various objects. For most of the sounds, the game uses their own FMOD_CustomEmitter, which I’m perfectly able to control the volume. But when trying to adjust the volume of FMOD_StudioEventEmitter, it just… doesn’t work?

I’ve tried looking through the API and guides and examples, but it’s been hard finding any information on what I could be doing wrong. Here’s what I’ve tried:

public static void FixVolume(FMOD_StudioEventEmitter studioEmitter)
{
    studioEmitter.evt.setVolume(myVolume);
    studioEmitter.GetComponent<EventInstance>().setVolume(myVolume);
}

I’m not sure what I’m doing wrong, so any pointers would be great!

Hi.

The function you are looking for is attached to the Event Instance its full function list is under FMOD API | Studio API Reference. To access the Event Instance from the Emitter is:

public static void FixVolume(FMODUnity.StudioEventEmitter studioEmitter)
{
    studioEmitter.EventInstance.setVolume(myVolume);
}

This is using FMOD’s Emitter so you might have to change to code accordingly.
If you can do that is it possible to get the FMOD_StudioEventEmitter code you are referencing?

Hope this helps!