Different localization for text and audio

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
samcsss
Posts: 9
Joined: Thu Sep 17, 2015 6:06 am

Different localization for text and audio

Post by samcsss »

Hey there!
I'm working on a game that requires me to allow the user to select the language for text and the language for audio voice-over independently - so subtitle text could appear in one language, while the audio is in another.
I wanted to use the entrytags to help me keep track of the localized audio.
I'm not afraid of scripting a solution, but wanted to confirm that this functionality isn't already available.
Thanks
Sam
User avatar
nathanj
Posts: 303
Joined: Sat May 28, 2016 12:30 am

Re: Different localization for text and audio

Post by nathanj »

Hey,

I could be completely over complicating this but you might want to look at using Dialogue System with Master Audio. Master Audio allows for localisation of audio files and Dialogue System offers a fantastic 3rd party support package for Master Audio.

https://assetstore.unity.com/packages/t ... sound-5607

They're my two favourite assets.

Nathan
User avatar
Tony Li
Posts: 22056
Joined: Thu Jul 18, 2013 1:27 pm

Re: Different localization for text and audio

Post by Tony Li »

I've never used Master Audio for that purpose, but it sounds like a good idea.

If you want to do this without Master Audio, I recommend setting the language for subtitles, and then using an additional Dialogue System variable for voiceover.

Let's say you want subtitles in English (language code 'en') and audio voiceover in French (language code 'fr').

Set the language to 'en' using any of the methods described in the Localization chapter's How To Check And Switch Languages section.

Set a dialogue database variable to 'fr'. For example, let's say the variable is named AudioLang.

Example:

Code: Select all

DialogueManager.SetLanguage("en");
DialogueLua.SetVariable("AudioLang", "fr");
Subtitles will appear in English. You don't need to do anything extra for them.

Use this sequencer command to play voiceover audio:

Code: Select all

AudioWait(entrytag [var=AudioLang])
The string "entrytag" will be replaced by a unique entrytag for each dialogue entry node. The tag "[var=AudioLang]" will be replaced by the value of the AudioLang variable.

You can set the entrytag format using the Dialogue Manager's Camera & Cutscene Settings > Entrytag Format dropdown. You can get a spreadsheet of all entrytags by exporting a voiceover script from the Dialogue Editor's Database section.

For example, let's say the entrytag for a dialogue entry is "Adam_27_42". Save the French voiceover as "Adam_27_42 fr", put it in a Resources folder or assetbundle, and you're in business.
samcsss
Posts: 9
Joined: Thu Sep 17, 2015 6:06 am

Re: Different localization for text and audio

Post by samcsss »

Thanks Tony,
That's a neat hack... and I like its simplicity. Will try that out.
Cheers,
Sam
Post Reply