| Article ID: | 218 |
| Last updated: | March 15, 2007 |
| User Opinions |
|
No users have voted.
|
|
Thank you for rating this answer.
|
SUMMARY
This article describes two methods for developing a multilingual voice application, so that audio files for the caller's chosen language are used at runtime.
SYMPTOMS
Developer would like to know how to create a multilingual voice application.
RESOLUTION
There are two main approaches to developing a multilingual application using Audium software. One option is to create multiple versions of the application, each configured to work with a particular language. The other option is to store each set of audio recordings in a different directory, and change the default audio directory (i.e. the currently active audio directory) based on which language the caller chooses. Regardless of which option is chosen, the voice application's xml:lang attribute should be changed to match the active language, so that the voice browser, ASR engine, and TTS engine are aware of the active language.
For the first option, using multiple language versions of the same application, a dispatch application should be created that prompts the user for a language and then performs an application transfer to the version that matches the caller's choice. This option is suitable for small applications, where the process of reconfiguring the application several times is not excessive.
To set the xml:lang attribute properly while using this solution, open the application Properties window, and enter the language under Audium - General Settings -> Language. Refer to the XML 1.0 specification for valid values of this attribute.
The second option is where the default audio path is changed based on the caller's language choice. This solution involves the creation of several audio directories, where the audio files in each directory are named consistently (i.e. the same filenames are used in each language's directory). Then, a custom Action element is created and added to the callflow that modifies the default audio path based on the caller's choice. This custom Action element need not be complex, its primary purpose is to determine which language the caller chose (e.g. examine an element data variable created by a menu element), and then call setDefaultAudioPath() (from the APIBase class) before exiting as "done". Additionally, this custom element should change the xml:lang attribute of future VoiceXML pages by calling the setMainDocumentLanguage() method (from APIBase as well).
Another variation of this option is available for those who wish to avoid writing custom Java code. Since substitution can be used in the URI setting of audio items, a pseudo default audio path can be created. For example, first set the desired audio path in session or element data. Then, in each element that should use this dynamic audio path, uncheck the "Use Default Audio Path" setting and then insert a substitution before the audio filename. This substitution should pull the path from the previously created session or element data. At program execution, this substitution will be replaced by the correct audio path for the chosen language, and the filename will be appended to the end. This solution also requires that all languages will use the same filenames.
|