How can I get callback when an async sound with quantization triggered?

I’m trying to create music stingers that align well with the BGM bars, and visual effect that aligns with such stingers. I need to know when such music stinger actually happens, as it is quantized to bars.

Currently, I’m using an async nested event that triggered by a parameter. My idea is to add a destination marker at the beginning of the nested event, and listen to FMOD_STUDIO_EVENT_CALLBACK_TIMELINE_MARKER. However, it seems this callback does not work for nested or referenced events.

Any suggestion?

Thanks,

Hi Yang,

That is correct, currently it is not possible to get event callbacks from nested or referenced events.

You can try placing all the stingers in the same music event and using the FMOD_STUDIO_EVENT_CALLBACK_SOUND_PLAYED callback to check when your instrument has been triggered (it will return its name).

Thanks,
Richard

1 Like

Hi Richard,

Thanks for your suggestion. I tried your idea, and it turns out the callback actually happens right after I set the parameter, rather than when the sound actually plays after a quantized delay. How could I monitor when the playback actually starts?

Thanks,
Yang

1 Like

Hi Yang,

You’re right - the SOUND_PLAYED callback is fired once the sound is created not when it’s played. I have raised a ticket internally to discuss this further.

In the meantime, I think the best alternative would be to set up a parameter (called “isPlaying” for example) and have a sidechain connected from the track the stingers are on. This way you can check if the isPlaying parameter’s value is more than 0 to see if any audio is playing or not.

Thanks,
Richard