| 123456789101112131415161718192021222324 |
- import Foundation
- import Combine
- /// Protocol abstracting audio recording capabilities.
- /// Allows swapping between Mock and Real (AVAudioEngine) implementations.
- protocol AudioRecorderProtocol: ObservableObject {
- /// Current recording state
- var isRecording: Bool { get }
- /// Elapsed recording time in seconds
- var elapsedTime: TimeInterval { get }
- /// Current amplitude level (0.0 - 1.0) for waveform visualization
- var currentAmplitude: Float { get }
- /// Rolling buffer of recent amplitude samples for waveform drawing
- var waveformSamples: [Float] { get }
- /// The local file URL of the current/last recording. nil for mock.
- var outputFileURL: URL? { get }
- /// Whether the active recording is paused
- var isPaused: Bool { get }
-
- func startRecording()
- func stopRecording()
- func pauseRecording()
- func resumeRecording()
- }
|