Made the transcribing callable and per-call for the transcribing protocol in the Recording package target.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
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 into text, letting the service be called directly as a function.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - audio: The recorded audio to transcribe.
|
||||
/// - locale: The locale of the spoken language to transcribe.
|
||||
/// - Returns: The transcription of the recorded audio.
|
||||
func callAsFunction(
|
||||
_ audio: Data,
|
||||
locale: Locale
|
||||
) async throws -> Transcription
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user