Guys, maybe someone can help:
I’m working in FMOD with UE5.4.
In our game the main character will have a voiceover in 2 languages.
Here while everything is clear - you make an event with 2 tracks.
the first language, the second language. make a parameter and mute one or the other track depending on the selected language.
The difficulty is that we have a hero’s speech is duplicated by subtitles and they must disappear at the moment when the speech ends.
When you work with one language, the UE can take the length of the asset in seconds from the event, and so you can easily synchronize the voiceover and subtitles, but when the event is 2 different voices on different tracks, it takes the length of the longest asset in the event but not the one that is now active, so there are problems with synchronization. Is there any variants how to fix it? to make different events for different languages is not an option.
Thanks in advance!
Apologies for the delayed response.
There are potentially ways of using parameters to control localized audio like this, but as you’ve noted, subtitling can become an issue. There are potentially ways to work around this, but the intended method to handle localized dialogue is to assign them to an audio table, and then to use programmer sounds in engine to play assets from the audio table based on what language is being used.
By placing a programmer instrument in an event in Studio, you can use the FMOD_STUDIO_EVENT_CALLBACK_TYPE type FMOD_STUDIO_EVENT_CALLBACK_CREATE_PROGRAMMER_SOUND
to receive a callback when the programmer sound is to play an asset, and use a localized audio table to select the asset to play based on the current language.
When the programmer sound asset stops playing, the callback FMOD_STUDIO_EVENT_CALLBACK_DESTROY_PROGRAMMER_SOUND
fires, which you can use to stop displaying the current subtitle. It would also be possible to use the length of the actual asset being played to determine the amount of time to display subtitles, which can be retrieved with Sound::getLength.
This only requires the use of a single event, so it would satisfy your need to avoid using different events for different languages. I would recommend giving programmer sounds a shot, and letting me know if you run into any issues or if there’s any reasons why this method doesn’t work for you.