Skip empty audio frames after filter buffering

Audio filters like RNNoise, KrispViva, and AIC return empty bytes while
buffering audio to accumulate their required frame size. These empty
frames were flowing downstream, causing misleading "Empty audio frame
received for STT service" warnings.

Skip the frame in BaseInputTransport when audio is empty, preventing
unnecessary processing in VAD and downstream processors.

Fixes #3517
This commit is contained in:
Mark Backman
2026-02-24 23:21:52 -05:00
parent 54fd73c460
commit a84930dc3e
2 changed files with 6 additions and 0 deletions

1
changelog/3828.fixed.md Normal file
View File

@@ -0,0 +1 @@
- Fixed misleading "Empty audio frame received for STT service" warnings when using audio filters (e.g. `RNNoiseFilter`, `KrispVivaFilter`, `AICFilter`) that buffer audio internally.

View File

@@ -424,6 +424,11 @@ class BaseInputTransport(FrameProcessor):
if self._params.audio_in_filter:
frame.audio = await self._params.audio_in_filter.filter(frame.audio)
# Skip frames with no audio data (e.g. filter is buffering).
if not frame.audio:
self._audio_in_queue.task_done()
continue
###################################################################
# DEPRECATED.
#