次の方法で共有


IRecognitionListener.OnLanguageDetection(Bundle) Method

Definition

Called when the language detection (and switching) results are available.

[Android.Runtime.Register("onLanguageDetection", "(Landroid/os/Bundle;)V", "GetOnLanguageDetection_Landroid_os_Bundle_Handler:Android.Speech.IRecognitionListener, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=34)]
public virtual void OnLanguageDetection (Android.OS.Bundle results);
[<Android.Runtime.Register("onLanguageDetection", "(Landroid/os/Bundle;)V", "GetOnLanguageDetection_Landroid_os_Bundle_Handler:Android.Speech.IRecognitionListener, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=34)>]
abstract member OnLanguageDetection : Android.OS.Bundle -> unit
override this.OnLanguageDetection : 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_ and 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

Called when the language detection (and switching) results are available. This callback can be invoked on any number of occasions at any time between #onBeginningOfSpeech() and #onEndOfSpeech(), depending on the speech recognition service implementation.

To request language detection, use RecognizerIntent#EXTRA_ENABLE_LANGUAGE_DETECTION.

To request automatic language switching, use RecognizerIntent#EXTRA_ENABLE_LANGUAGE_SWITCH.

Java documentation for android.speech.RecognitionListener.onLanguageDetection(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