RecognitionService.Callback.LanguageDetection(Bundle) Method

Definition

The service should call this method when the language detection (and switching) results are available.

[Android.Runtime.Register("languageDetection", "(Landroid/os/Bundle;)V", "GetLanguageDetection_Landroid_os_Bundle_Handler", ApiSince=34)]
public virtual void LanguageDetection (Android.OS.Bundle results);
[<Android.Runtime.Register("languageDetection", "(Landroid/os/Bundle;)V", "GetLanguageDetection_Landroid_os_Bundle_Handler", ApiSince=34)>]
abstract member LanguageDetection : Android.OS.Bundle -> unit
override this.LanguageDetection : Android.OS.Bundle -> unit

Parameters

results
Bundle

the returned language detection (and switching) results. <p> To retrieve the most confidently detected language IETF tag (as defined by BCP 47, e.g., "en-US", "de-DE"), use Bundle#getString(String) with SpeechRecognizer#DETECTED_LANGUAGE as the parameter. <p> To retrieve the language detection confidence level represented by a value prefixed by LANGUAGE_DETECTION_CONFIDENCE_LEVEL_ defined in SpeechRecognizer, use Bundle#getInt(String) with SpeechRecognizer#LANGUAGE_DETECTION_CONFIDENCE_LEVEL as the parameter. <p> To retrieve the alternative locales for the same language retrieved by the key SpeechRecognizer#DETECTED_LANGUAGE, use Bundle#getStringArrayList(String) with SpeechRecognizer#TOP_LOCALE_ALTERNATIVES as the parameter. <p> To retrieve the language switching results represented by a value prefixed by LANGUAGE_SWITCH_RESULT_ and defined in SpeechRecognizer, use Bundle#getInt(String) with SpeechRecognizer#LANGUAGE_SWITCH_RESULT as the parameter.

Attributes

Remarks

The service should call this method when the language detection (and switching) results are available. This method can be called on any number of occasions at any time between #beginningOfSpeech() and #endOfSpeech(), depending on the speech recognition service implementation.

Java documentation for android.speech.RecognitionService.Callback.languageDetection(android.os.Bundle).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to