Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/4076.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed SimliVideoService forwarding near-silent audio frames (quantization noise) as TTSAudioRawFrame. Added RMS threshold check to skip frames below 1.0, which is well above the observed noise floor (~0.41) but far below real speech. Without this fix - BotStoppedSpeaking will never trigger.
5 changes: 3 additions & 2 deletions src/pipecat/services/simli/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,9 @@ async def _consume_and_process_audio(self):
resampled_frames = self._pipecat_resampler.resample(audio_frame)
for resampled_frame in resampled_frames:
audio_array = resampled_frame.to_ndarray()
# Only push frame is there is audio (e.g. not silence)
if audio_array.any():
# Simli pushes very low volume (total silence for practical purposes) frames when the avatar is not speaking, so we can skip otherwise BotStoppedSpeaking will never trigger.
rms = np.sqrt(np.mean(audio_array.astype(np.float32) ** 2))
if rms >= 1.0:
await self.push_frame(
TTSAudioRawFrame(
audio=audio_array.tobytes(),
Expand Down
Loading