Status: ratified — shipped 2026-04-26 (Sources/OpenQuackKit/Audio/AudioRecorder.swift)
Owner: OpenQuackKit/Audio/
Last updated: 2026-04-26
Capture microphone audio during a recording session into a buffer suitable for transcription: 16 kHz mono Float32. Cleanly start, stop, and cancel.
public actor AudioRecorder {
public init(sampleRate: Double = 16_000)
public func start() throws
public func stop() async -> [Float] // 16 kHz mono float32, peak-normalised? TBD
public func cancel() async
public var isRecording: Bool { get async }
/// 0.0 ... 1.0 short-term audio level for the overlay's level meter.
public var currentLevel: Float { get async }
}
AVAudioEngine with a single input tap on the input node’s bus 0.Float32 16 kHz via AVAudioConverter.[Float]. Empty array if recording was cancelled.NSMicrophoneUsageDescription once on first start().start() throws AudioError.permissionDenied. App should show a settings deep link (handled by the app shell, not this module).start() returning to first sample captured (no perceptible “missed first word”).