# Current Track Duration or End Callback in Multi-Instrument VO Event

**URL:** <https://qa.fmod.com/t/current-track-duration-or-end-callback-in-multi-instrument-vo-event/23186>\
**Category:** Unity\
**Tags:** unity, csharp\
**Created:** [July 22, 2025, 8:40am UTC](https://qa.fmod.com/t/current-track-duration-or-end-callback-in-multi-instrument-vo-event/23186 "2025-07-22T08:40:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ertugun](https://avatars.discourse-cdn.com/v4/letter/e/aeb1de/32.png) [@ertugun](https://qa.fmod.com/u/ertugun)\
**Post date:** [July 22, 2025, 8:40am UTC](https://qa.fmod.com/t/current-track-duration-or-end-callback-in-multi-instrument-vo-event/23186/1 "2025-07-22T08:40:23Z")

</div>

Hi everyone,

I’m working on a project using Unity and FMOD that supports multiple languages and includes nearly 100 games with VO events. Each VO event contains multiple tracks configured using Multi-Instrument modules. We are using a manual localization method: inside each VO event, we’ve added two tracks (e.g., ENG and TUR), and we use a continuous parameter to control which one is actually playing via volume automation.

I’ve previously read that FMOD’s built-in localization system doesn’t work well when localization is handled via labeled parameters and Multi-Instrument setups like this ([Localized VO System](https://qa.fmod.com/t/localized-vo-system/18571)).

Here’s the issue:

When trying to get the actual duration of the currently playing sound inside an EventInstance, FMOD seems to return the total duration of the event or the entire Multi-Instrument group — not just the currently audible segment. Moreover, the stopped callback is only triggered once the entire track ends, not the individual playing instrument.

To work around this, after starting the event I wait a few frames, then use getChannelGroup() to inspect the sub groups. I check which one has volume \> 0 to detect the currently playing track, and then I try to retrieve the playing sound and get its duration via Sound.getLength.

This works in some cases, but when localization tracks are set up using Multi-Instruments, it still returns the full track length rather than the specific playing variation.

So my question is:  
Is there a reliable way to get the duration of only the currently playing instrument inside a Multi-Instrument setup — or at least receive a callback when only that instrument finishes playing, not the full group?

Any tips or alternative approaches would be much appreciated!

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [July 23, 2025, 2:21am UTC](https://qa.fmod.com/t/current-track-duration-or-end-callback-in-multi-instrument-vo-event/23186/2 "2025-07-23T02:21:10Z")

</div>

Hi,

Event instances allow you to [set a callback](https://www.fmod.com/docs/2.02/api/studio-api-eventinstance.html#studio_eventinstance_setcallback) that are fired at a number of key moments. For your purposes, [`FMOD_STUDIO_EVENT_CALLBACK_SOUND_PLAYED`](https://www.fmod.com/docs/2.02/api/studio-api-eventinstance.html#fmod_studio_event_callback_sound_played) will allow you to access the underlying [`sound`](https://www.fmod.com/docs/2.02/api/core-api-sound.html) that is about to be played by the event. [`FMOD_STUDIO_EVENT_CALLBACK_SOUND_STOPPED`](https://www.fmod.com/docs/2.02/api/studio-api-eventinstance.html#fmod_studio_event_callback_sound_stopped) does the same, but is fired when the sound stops being played. You can then use any of the `Sound` functions to get any info about the sound that you need e.g. [`Sound::getLength`](https://www.fmod.com/docs/2.02/api/core-api-sound.html#sound_getlength), [`Sound::getName`](https://www.fmod.com/docs/2.02/api/core-api-sound.html#sound_getname), etc.

Since you’re working with C#, if you want to pass that info in and out of the callback, you’ll need to pin some kind of variable/struct/class in memory and[pass it to the event as user data](https://www.fmod.com/docs/2.02/api/studio-api-eventinstance.html#studio_eventinstance_setuserdata) to be[retrieved](https://www.fmod.com/docs/2.02/api/studio-api-eventinstance.html#studio_eventinstance_getuserdata) in the callback so you can set that data. Take a look at how this is handled in our [Unity Timeline Callbacks example](https://www.fmod.com/docs/2.02/unity/examples-timeline-callbacks.html) for an example of how to do so.

---

<div class="post-metadata">

**Author:** ![ertugun](https://avatars.discourse-cdn.com/v4/letter/e/aeb1de/32.png) [@ertugun](https://qa.fmod.com/u/ertugun)\
**Post date:** [July 23, 2025, 9:26am UTC](https://qa.fmod.com/t/current-track-duration-or-end-callback-in-multi-instrument-vo-event/23186/3 "2025-07-23T09:26:48Z")

</div>

We had difficulty reliably retrieving the duration of only the currently playing track in VO events using Multi-Instrument with multiple tracks. Since the Localization parameter mutes all but one track, we used the SOUND\_PLAYED callback to inspect the name of the played Sound, filtered it based on the active locale, and retrieved the duration only if it matched. This approach allowed us to accurately get the duration of the correct track in Multi-Instrument setups.
