From ff4f90612856b4f4ebf7563ada3d20039cee73a1 Mon Sep 17 00:00:00 2001 From: Trey t Date: Mon, 13 Apr 2026 19:00:51 -0500 Subject: [PATCH] Fix crash from zero-length audio buffers in speech recognition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Guard against empty audio buffers before appending to speech recognition request — AVAudioBuffer asserts non-zero data size. Co-Authored-By: Claude Opus 4.6 (1M context) --- Conjuga/Conjuga/Services/PronunciationService.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Conjuga/Conjuga/Services/PronunciationService.swift b/Conjuga/Conjuga/Services/PronunciationService.swift index 0177bb9..fee2995 100644 --- a/Conjuga/Conjuga/Services/PronunciationService.swift +++ b/Conjuga/Conjuga/Services/PronunciationService.swift @@ -86,6 +86,7 @@ final class PronunciationService { } inputNode.installTap(onBus: 0, bufferSize: 1024, format: recordingFormat) { buffer, _ in + guard buffer.frameLength > 0 else { return } request.append(buffer) }