Updated the Capturing procotol in the Recording package target to pass captured audio as a file URL instead of data.

This commit is contained in:
2026-07-04 15:06:55 +02:00
parent 2fe240de1a
commit 6a0e7698a5
10 changed files with 116 additions and 119 deletions
@@ -19,7 +19,7 @@ public protocol Capturing: Sendable {
/// Stops the recording.
///
/// - Returns: The audio captured since the recording started.
func stop() async throws -> Data
/// - Returns: The location of the audio file captured since the recording started.
func stop() async throws -> URL
}
@@ -8,14 +8,14 @@ public protocol Transcribing: Sendable {
// MARK: Methods
/// Transcribes the given recorded audio into text, letting the service be called directly as a function.
/// Transcribes the given recorded audio file into text, letting the service be called directly as a function.
///
/// - Parameters:
/// - audio: The recorded audio to transcribe.
/// - 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: Data,
_ audio: URL,
locale: Locale
) async throws -> Transcription