Fix crash from zero-length audio buffers in speech recognition

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) <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-04-13 19:00:51 -05:00
parent 23ff9d66de
commit ff4f906128

View File

@@ -86,6 +86,7 @@ final class PronunciationService {
} }
inputNode.installTap(onBus: 0, bufferSize: 1024, format: recordingFormat) { buffer, _ in inputNode.installTap(onBus: 0, bufferSize: 1024, format: recordingFormat) { buffer, _ in
guard buffer.frameLength > 0 else { return }
request.append(buffer) request.append(buffer)
} }