16 lines
659 B
Swift
16 lines
659 B
Swift
import Foundation
|
|||
|
|
|
||
|
|
/// A service that transcribes recorded audio into text for the Recording feature.
|
||
|
|
///
|
||
|
|
/// ``RecordingView`` attaches the service to its model at initialization, so the transcription can be swapped without touching the feature's
|
||
|
|
/// state machine — for example, with a real transcription backend in the app, or with a fast mock in unit tests.
|
||
|
|
public protocol TranscribingService: Sendable {
|
||
|
|
|
||
|
|
/// Transcribes the given recorded audio into text.
|
||
|
|
///
|
||
|
|
/// - Parameter audio: The recorded audio to transcribe.
|
||
|
|
/// - Returns: The transcription of the recorded audio.
|
||
|
|
func transcribe(_ audio: Data) async throws -> String
|
||
|
|
|
||
|
|
}
|