Access Programmer Instrument from EventInstance reference

Hey all,
I have an event setup with 3 programmer instruments on it set to loop indefinitely.
I have an audio table setup (there will be a hundred or so different audio clips).

When user’s perform certain things in Unity I’d like to be able to swap the audio clip which is playing in a specific programmer instrument and keeping the playback in sync with the other clips, not re-starting.

Firstly, is this (changing the programer sound while it’s playing in a loop) possible?
and if it is, how do I access the individual programmer instrument from the EventInstance reference?

Hi,

Once a programmer sound has been started you can’t change its audio file. An option may be starting a second event with a programmer instrument so that you can fade in and out of the events.

You can use FMOD_STUDIO_PROGRAMMER_SOUND_PROPERTIES::name to access the individual programmer instruments. I used an if() statement to check the name of the instrument and then changed the file passed in from the audio file:

FMOD_STUDIO_PROGRAMMER_SOUND_PROPERTIES* props = (FMOD_STUDIO_PROGRAMMER_SOUND_PROPERTIES*)parameters;
std::string stringName = props->name;
if (stringName == "First")

Hope this helps!

1 Like

Thanks @Connor_FMOD I will look into an alternative solution

1 Like