Extracted the error types in the Recording package target into the Errors folder.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
/// The errors thrown by ``AudioCapturing``.
|
||||
public enum AudioCapturingError: Error {
|
||||
/// The recorder failed to start or resume the audio capture.
|
||||
case captureNotStarted
|
||||
/// No recording is in progress.
|
||||
case noOngoingRecording
|
||||
/// The user denied the app permission to record audio from the microphone.
|
||||
case permissionNotGranted
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
/// The errors thrown by ``AudioTranscribing``.
|
||||
public enum AudioTranscribingError: Error {
|
||||
/// The speech model assets for the locale failed to reserve, download, or install.
|
||||
case assetsNotInstalled
|
||||
/// The transcriber supports no equivalent of the locale the transcription was requested with.
|
||||
case localeNotSupported
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import Foundation
|
||||
|
||||
/// An error of the recording flow, surfaced to the user by ``RecordingView``.
|
||||
public enum RecordingError: Error, Equatable, Sendable {
|
||||
/// The speech model assets for the locale to transcribe could not be reserved or installed.
|
||||
case assetsUnavailable
|
||||
/// The audio capture failed to start, resume, or stop.
|
||||
case captureFailed
|
||||
/// The user denied the app permission to record audio from the microphone.
|
||||
case permissionDenied
|
||||
/// The recorded audio failed to transcribe.
|
||||
case transcriptionFailed
|
||||
}
|
||||
Reference in New Issue
Block a user