Multilinguality
In Chapter 2, Text-to-Speech Synthesis and Chapter 3, Speech Recognition, we have provided the groundwork to enable you to develop multilingual applications easily. With the TTSLib
library (Chapter 2, Text-to-Speech Synthesis) you can specify the language used for speech synthesis. Now we only need to make some small improvements to the ASRLib
(Chapter 3, Speech Recognition) to make it accept different languages for speech recognition (as it was set originally to the device's default). To do this, we have created the ASRMultilingualLib
(in sandra.libs.asr.asrmultilinguallib
) in the code bundle).
We cannot expect that all languages will be available in the user's implementation of voice recognition. Thus, before setting a language it is necessary to check whether it is one of the supported languages, and if not, to set the currently preferred language.
To do this, a RecognizerIntent.ACTION_GET_LANGUAGE_DETAILS
ordered broadcast is sent that returns a Bundle from which the information...