Skip to main content

Error code

The SpeechToText SDK delivers errors that occur during initialization, app registration, and speech recognition as ErrorType. Errors can be handled in OnInitializeListener, OnServerConnectionListener, or ResultListener.

ErrorType

ErrorTypeDescriptionRecommended action
AUDIO_ERRORFailed to process input audio data.Check the input data and audio format, then request again.
INVALID_REQUEST_ERRORThe request value or request status is incorrect.Verify the call sequence, duplicate requests, and input values.
MIC_ERRORAn error occurred while starting or processing microphone input.Check the microphone status and sensor privacy settings.
NETWORK_ERRORFailed to communicate over the network.Check the network connection and request again.
NOT_SUPPORTED_APIThe API is not supported in the current mode or execution environment.Verify the support range of the selected Mode and platform.
ON_DEVICE_ENGINE_ERRORAn error occurred in the on-device speech recognition engine.Check the engine status or review HYBRID or SERVER mode.
PERMISSION_DENIEDNo access permission to the SpeechToText service.Check the STT_SERVICE permission in the manifest and the permission status of the execution environment.
SERVER_INTERNAL_ERRORAn internal error occurred in the Speech Service.Request again later, and if it repeats, contact the service administrator.
TIMEOUTThe request was not completed within the time limit.Check the network and server status, then request again.
UNAUTHENTICATEDApp authentication failed.Verify the credentials of My Project in Pleos Playground or UA app information and access environment.
UNAVAILABLE_LANGUAGEThe requested language is not available.Change to a supported Locale.
UNKNOWNAn unclassified error occurred.Collect the call timing and environment information and contact the service administrator.
UNCLASSIFIED(message)An error not defined by the SDK, including the original message.Record the message without sensitive information and identify the cause according to the message.

Handle errors

Since new error types can be added to ErrorType, it is recommended to include a default branch in when or switch statements.

override fun onError(errorType: ErrorType) {
when (errorType) {
ErrorType.PERMISSION_DENIED -> checkSttPermission()
ErrorType.UNAUTHENTICATED -> checkCredentials()
ErrorType.NETWORK_ERROR,
ErrorType.TIMEOUT -> retryWhenNetworkIsAvailable()
is ErrorType.UNCLASSIFIED -> logError(errorType.message)
else -> logError(errorType.name)
}
}

The exact declaration of each error type can be found in the SpeechToText API Reference.