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:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user