Speech: Public API for the language detection and switching features
onLanguageDetection callback method is added to IRecognitionListener aidl, and is to be called when the language detection (and switching) results are available. This callback method can be invoked on any number of occasions at any time between the beginning and the end of speech, depending on the speech recognition service implementation. The following entities are created for the language detection feature: - `android.speech.extra.ENABLE_LANGUAGE_DETECTION` and `android.speech.extra.LANGUAGE_DETECTION_ALLOWED_LANGUAGES` key entries for the RecognizerIntent extras; - `detected_language`, `language_detection_confidence_level` and `top_locale_alternatives` key entries for the SpeechRecognizer result Bundle; - Language detection confidence levels valued as `UNKNOWN`, `NOT_CONFIDENT`, `CONFIDENT` and `HIGHLY_CONFIDENT`. The following entities are created for the language switch feature: - `android.speech.extra.ENABLE_LANGUAGE_SWITCH` and `android.speech.extra.LANGUAGE_SWITCH_ALLOWED_LANGUAGES` key entries for the RecognizerIntent extras; - Language switch sensitivity levels valued as `high_precision`, `balanced`, and `quick_response`. - `language_switch_result` key entry for the SpeechRecognizer result Bundle; - Language switch results valued as `NOT_ATTEMPTED`, `SUCCEEDED`, `FAILED` and `SKIPPED_NO_MODEL`. Bug: 268317656 Bug: 268475583 Test: CTS Change-Id: I52266b1676535812c9f036149bf3a46f2aaf2340
Loading
Please register or sign in to comment