Reorganized the Recording package target into folders.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import Foundation
|
||||
|
||||
/// A service that captures audio from a microphone for the Recording feature.
|
||||
///
|
||||
/// ``RecordingView`` attaches the service to its model at initialization, so the audio capture can be swapped without touching the feature's
|
||||
/// state machine — for example, with a real microphone backend in the app, or with a mock in unit tests.
|
||||
public protocol RecordingService: Sendable {
|
||||
|
||||
/// Starts a new audio recording from the microphone.
|
||||
func start() async throws
|
||||
|
||||
/// Pauses the ongoing recording.
|
||||
func pause() async throws
|
||||
|
||||
/// Resumes a paused recording.
|
||||
func resume() async throws
|
||||
|
||||
/// Stops the recording.
|
||||
///
|
||||
/// - Returns: The audio captured since the recording started.
|
||||
func stop() async throws -> Data
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
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
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user