From 374af47a0d3a4a05a0518cfac0bf78b5702e98f9 Mon Sep 17 00:00:00 2001 From: Sam Sykes Date: Wed, 4 Mar 2026 10:20:18 +0000 Subject: [PATCH] fix: pass audio sample rate and width to Silero VAD Silero VAD process_audio was called without sample_rate or sample_width, defaulting to 16kHz. With 8kHz audio this silently produced incorrect VAD results instead of surfacing the incompatibility. --- sdk/voice/speechmatics/voice/_client.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sdk/voice/speechmatics/voice/_client.py b/sdk/voice/speechmatics/voice/_client.py index c0988dd3..1bbc5a60 100644 --- a/sdk/voice/speechmatics/voice/_client.py +++ b/sdk/voice/speechmatics/voice/_client.py @@ -660,7 +660,13 @@ async def send_audio(self, payload: bytes) -> None: # Process with Silero VAD if self._silero_detector: - asyncio.create_task(self._silero_detector.process_audio(payload)) + asyncio.create_task( + self._silero_detector.process_audio( + payload, + sample_rate=self._audio_sample_rate, + sample_width=self._audio_sample_width, + ) + ) # Add to audio buffer (use put_bytes to handle variable chunk sizes) if self._config.audio_buffer_length > 0: