diff --git a/android/src/main/kotlin/com/csdcorp/speech_to_text/SpeechToTextPlugin.kt b/android/src/main/kotlin/com/csdcorp/speech_to_text/SpeechToTextPlugin.kt index acde10f9..ff81957e 100644 --- a/android/src/main/kotlin/com/csdcorp/speech_to_text/SpeechToTextPlugin.kt +++ b/android/src/main/kotlin/com/csdcorp/speech_to_text/SpeechToTextPlugin.kt @@ -332,11 +332,11 @@ class SpeechToTextPlugin(activity: Activity, channel: MethodChannel) : SpeechRecognizer.ERROR_CLIENT -> "error_client" SpeechRecognizer.ERROR_INSUFFICIENT_PERMISSIONS -> "error_permission" SpeechRecognizer.ERROR_NETWORK -> "error_network" - SpeechRecognizer.ERROR_NETWORK_TIMEOUT -> "error_timeout" + SpeechRecognizer.ERROR_NETWORK_TIMEOUT -> "error_network_timeout" SpeechRecognizer.ERROR_NO_MATCH -> "error_no_match" SpeechRecognizer.ERROR_RECOGNIZER_BUSY -> "error_busy" SpeechRecognizer.ERROR_SERVER -> "error_server" - SpeechRecognizer.ERROR_SPEECH_TIMEOUT -> "error_timeout" + SpeechRecognizer.ERROR_SPEECH_TIMEOUT -> "error_speech_timeout" else -> "error_unknown" } sendError(errorMsg) diff --git a/lib/speech_to_text.dart b/lib/speech_to_text.dart index 55f84e11..96479fde 100644 --- a/lib/speech_to_text.dart +++ b/lib/speech_to_text.dart @@ -13,6 +13,17 @@ typedef SpeechResultListener = void Function(SpeechRecognitionResult result); /// Notified if errors occur during recognition or intialization. /// +/// Possible errors per the Android docs are described here: +/// https://developer.android.com/reference/android/speech/SpeechRecognizer +/// "error_audio_error" +/// "error_client" +/// "error_permission" +/// "error_network" +/// "error_network_timeout" +/// "error_no_match" +/// "error_busy" +/// "error_server" +/// "error_speech_timeout" /// See the [onError] argument on the [initialize] method for use. typedef SpeechErrorListener = void Function( SpeechRecognitionError errorNotification);