Skip to content

3. Localisations

Vikram Ezhil edited this page Apr 12, 2020 · 3 revisions

Droid Speech 2.0 supports speech recognition for different localisations. The listener method onDksLanguagesAvailable will provide the device supported languages details.

An example on setting preferred language is given below,

Setting preferred local language

override fun onDksLanguagesAvailable(defaultLanguage: String?, supportedLanguages: ArrayList<String>?) {
   if (supportedLanguages != null && supportedLanguages.contains("ta-IN")) {
      // Setting the speech recognition language to tamil if found
      dks.currentSpeechLanguage = "ta-IN"
   }
}
Clone this wiki locally