Hello there!
I'm looking to set up a locale for text, and a locale for audio. They could be different in our project (for example having a conversation in english but having french subtitles). Is this supported? Is there a way to do this?
Thanks in advance
Different locales for audio/subtitles
Re: Different locales for audio/subtitles
Hi,
Audio usually uses entrytags. Let's say these two things are true:
1. Name the English audio clips according to their entrytags, such as Player_7_42
2. In the Dialogue Manager's Default Sequence, use: AudioWait(entrytag)
3. Set the language to French: DialogueManager.SetLanguage("fr");
This will play the English entrytag audio and show subtitles in French.
If you later record audio for other languages, name them by their entrytaglocal values: Player_7_42_fr. Then change the sequencer command to: AudioWait(entrytaglocal)
Audio usually uses entrytags. Let's say these two things are true:
- Your database's default language is English, and you've also added localized text in French ("fr").
- You have recorded audio in English.
1. Name the English audio clips according to their entrytags, such as Player_7_42
2. In the Dialogue Manager's Default Sequence, use: AudioWait(entrytag)
3. Set the language to French: DialogueManager.SetLanguage("fr");
This will play the English entrytag audio and show subtitles in French.
If you later record audio for other languages, name them by their entrytaglocal values: Player_7_42_fr. Then change the sequencer command to: AudioWait(entrytaglocal)
Re: Different locales for audio/subtitles
Hi Tony, thank you for your help!
In our database we actually have all the audio and texts ready in the different languages.
What I meant was more to have 2 different locales settings and be able to change them in runtime. A player could decide to choose a locale for the audio that is different from the subtitles.
Could something link this be possible?
- DialogueManager.SetAudioLanguage("fr");
- DialogueManager.SetSubtitleLanguage("en");
In our database we actually have all the audio and texts ready in the different languages.
What I meant was more to have 2 different locales settings and be able to change them in runtime. A player could decide to choose a locale for the audio that is different from the subtitles.
Could something link this be possible?
- DialogueManager.SetAudioLanguage("fr");
- DialogueManager.SetSubtitleLanguage("en");
Re: Different locales for audio/subtitles
Hi,
Yes.
Use DialogueManager.SetLanguage("en") to set the subtitles to English.
Name your audio files like Player_7_42_en, Player_7_42_fr, etc.
Use a sequencer command like this to play audio:
Then set the audioLanguage variable:
At runtime [var=audioLanguage] will be replaced by the variable value ("fr"), so if the entrytag is "Player_7_42" then the whole "entrytag_[var=audioLanguage]" will be "Player_7_42_fr".
Yes.
Use DialogueManager.SetLanguage("en") to set the subtitles to English.
Name your audio files like Player_7_42_en, Player_7_42_fr, etc.
Use a sequencer command like this to play audio:
Code: Select all
AudioWait(entrytag_[var=audioLanguage])
Code: Select all
DialogueLua.SetVariable("audioLanguage", "fr");
Re: Different locales for audio/subtitles
Hi Tony, this is a genius idea.
Thank you for this I could have never thought this was possible!
Thank you for this I could have never thought this was possible!
Re: Different locales for audio/subtitles
Glad to help!