Files

23 lines
885 B
Swift
Raw Permalink Normal View History

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 Transcribing: Sendable {
// MARK: Methods
/// Transcribes the given recorded audio file into text, letting the service be called directly as a function.
///
/// - Parameters:
/// - audio: The location of the recorded audio file to transcribe.
/// - locale: The locale of the spoken language to transcribe.
/// - Returns: The transcription of the recorded audio.
func callAsFunction(
_ audio: URL,
locale: Locale
) async throws -> Transcription
}