If you are localizing your game into multiple languages, you will likely need to load and play different audio files for dialogue and voice-overs depending on your game's current language.
If you are using Wwise for your game's audio, you can take advantage of the audio localization system built in to the Wwise editor. The Wwise engine transparently takes care of loading and playing only audio files that match your choice of language.
Setting this up involves assigning the language of each audio file when you import it into your Wwise project, and configuring your game to set the current language for the Wwise engine at runtime.
In this step, you add support for your target languages into your Wwise project.
Open the Wwise project for your Stingray project. From the main menu bar in Wwise, select Project > Languages...
In the Language Manager window, move all the languages you want to support from the Available Languages list into the Project Languages list.
You can set any of your project languages as the "reference" language, and specify whether or not Wwise should fall back on the reference language when a sound does not have a localized audio file in the current language.
Click OK.
For each sound that you need to localize in your Wwise project:
Import an audio file for the reference language (typically English). In the Audio File Importer window, use the following settings:
Import a localized version of the same audio file for each target language. In the Audio File Importer window, select "Localize languages".
Note that the audio files need to have the same filename in all languages.
For a video overview that illustrates this process, see this video from Audiokinetic. For additional details, see the Wwise documentation.
When you want to change languages in your game at runtime, use the following sequence of events:
Unload any sound banks that you currently have loaded.
The Wwise engine only loads audio files into memory that match its current language setting. This avoids consuming memory at runtime to hold localized sounds that will likely never be needed. If you have any sound banks already loaded in your game, the new language setting will not affect them. Any sounds you play from those banks will continue to sound in the language that was in effect at the time they were loaded.
Therefore, if you have any sound banks already loaded, you should consider unloading them before switching languages.
Set the current language.
In your Stingray game project, you can set the current language for the Wwise project at any time using either of the following methods:
The language name you pass to the Flow node or the Lua function must match the name of the language in Wwise, without spaces. For example, English(US), German, Italian.
Load or reload your sound banks. The Wwise engine now loads the audio that matches the new language setting.