-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: isAvailable check implemented + several DX optimizations & fixes
- Loading branch information
Showing
16 changed files
with
643 additions
and
384 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.voicekit | ||
|
||
sealed class VoiceError( | ||
val code: String, | ||
val message: String | ||
) { | ||
object SpeechRecognizerNotAvailable : VoiceError( | ||
"ERR_SPEECH_RECOGNIZER_NOT_AVAILABLE", | ||
"Speech recognition is not available on this device" | ||
) | ||
object RecordingStartFailed : VoiceError( | ||
"ERR_RECORDING_START_FAILED", | ||
"Failed to start audio recording" | ||
) | ||
object RecognitionFailed : VoiceError( | ||
"ERR_RECOGNITION_FAILED", | ||
"Failed to recognize speech" | ||
) | ||
object PermissionDenied : VoiceError( | ||
"ERR_PERMISSION_DENIED", | ||
"Speech recognition permission was denied" | ||
) | ||
object PermissionRestricted : VoiceError( | ||
"ERR_PERMISSION_RESTRICTED", | ||
"Speech recognition is restricted on this device" | ||
) | ||
object PermissionNotDetermined : VoiceError( | ||
"ERR_PERMISSION_NOT_DETERMINED", | ||
"Speech recognition permission was not yet determined" | ||
) | ||
class Unknown(message: String = "An unknown error occurred") : VoiceError( | ||
"ERR_UNKNOWN", | ||
message | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.