feat: add menu bar app and bundle script
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -31,6 +31,7 @@ public final class AudioRecorder: AudioRecording {
|
||||
}
|
||||
let ratio = targetFormat.sampleRate / inputFormat.sampleRate
|
||||
|
||||
input.removeTap(onBus: 0)
|
||||
input.installTap(onBus: 0, bufferSize: 4096, format: inputFormat) { [weak self] pcm, _ in
|
||||
guard let self else { return }
|
||||
let capacity = AVAudioFrameCount(Double(pcm.frameLength) * ratio) + 1
|
||||
@@ -52,7 +53,12 @@ public final class AudioRecorder: AudioRecording {
|
||||
self.lock.withLock { self.buffer.append(contentsOf: samples) }
|
||||
}
|
||||
engine.prepare()
|
||||
try engine.start()
|
||||
do {
|
||||
try engine.start()
|
||||
} catch {
|
||||
input.removeTap(onBus: 0)
|
||||
throw error
|
||||
}
|
||||
}
|
||||
|
||||
public func stop() -> [Float] {
|
||||
|
||||
Reference in New Issue
Block a user