From 0e99400148210745fb66225ef520e0fde274be9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6kmen=20G=C3=B6rgen?= Date: Tue, 20 Jan 2026 14:03:10 +0100 Subject: [PATCH] two dots are rust specific thinks, I'm not sure if it's familiar for Python developers. --- src/pipecat/audio/filters/aic_filter.py | 14 ++++++++------ src/pipecat/audio/vad/aic_vad.py | 14 +++++++------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/pipecat/audio/filters/aic_filter.py b/src/pipecat/audio/filters/aic_filter.py index 79c2ed547..05536aebf 100644 --- a/src/pipecat/audio/filters/aic_filter.py +++ b/src/pipecat/audio/filters/aic_filter.py @@ -37,7 +37,7 @@ class AICFilter(BaseAudioFilter): """Audio filter using ai-coustics' AIC SDK for real-time enhancement. Buffers incoming audio to the model's preferred block size and processes - frames using float32 samples normalized to the -1..+1 range. + frames using float32 samples normalized to the range -1 to +1. .. note:: This class requires aic-sdk ~= 2.0.0 (uses 'aic_sdk' module). @@ -90,7 +90,9 @@ class AICFilter(BaseAudioFilter): # Audio format constants self._bytes_per_sample = 2 # int16 = 2 bytes self._dtype = np.int16 - self._scale = 32768.0 # 2^15, for normalizing int16 (-32768..32767) to float32 (-1.0..1.0) + self._scale = ( + 32768.0 # 2^15, for normalizing int16 (-32768 to 32767) to float32 (-1.0 to 1.0) + ) # AIC SDK objects self._model = None @@ -125,13 +127,13 @@ class AICFilter(BaseAudioFilter): AIC VAD parameters: - speech_hold_duration: How long VAD continues detecting after speech ends (in seconds). - Range: 0.0 .. 20x model window length, Default (SDK): 0.05s + Range: 0.0 to 20x model window length, Default (SDK): 0.05s - minimum_speech_duration: Minimum duration of speech required before VAD reports speech detected - (in seconds). Range: 0.0 .. 1.0, Default (SDK): 0.0s + (in seconds). Range: 0.0 to 1.0, Default (SDK): 0.0s - sensitivity: Energy threshold sensitivity. Energy threshold = 10 ** (-sensitivity). - Range: 1.0 .. 15.0, Default (SDK): 6.0 + Range: 1.0 to 15.0, Default (SDK): 6.0 Args: speech_hold_duration: Optional speech hold duration to configure on the VAD. @@ -139,7 +141,7 @@ class AICFilter(BaseAudioFilter): minimum_speech_duration: Optional minimum speech duration before VAD reports speech detected. If None, SDK default (0.0s) is used. sensitivity: Optional sensitivity (energy threshold) to configure on the VAD. - Range: 1.0 .. 15.0. If None, SDK default (6.0) is used. + Range: 1.0 to 15.0. If None, SDK default (6.0) is used. Returns: A lazily-initialized AICVADAnalyzer that will bind to the VAD context diff --git a/src/pipecat/audio/vad/aic_vad.py b/src/pipecat/audio/vad/aic_vad.py index d263bf9d3..17df6d094 100644 --- a/src/pipecat/audio/vad/aic_vad.py +++ b/src/pipecat/audio/vad/aic_vad.py @@ -4,7 +4,7 @@ This module provides VAD analyzer implementations that query the AIC SDK's is_speech_detected() and map it to a float confidence (1.0/0.0). Classes: - AICVADAnalyzer: For aic-sdk >= 2.0.0 (uses 'aic_sdk' module) + AICVADAnalyzer: For aic-sdk (uses 'aic_sdk' module) """ from typing import Any, Callable, Optional @@ -27,16 +27,16 @@ class AICVADAnalyzer(VADAnalyzer): - speech_hold_duration: Controls for how long the VAD continues to detect speech after the audio signal no longer contains speech (in seconds). - Range: 0.0 .. 20x model window length + Range: 0.0 to 20x model window length Default (SDK): 0.05s (50ms) - minimum_speech_duration: Controls for how long speech needs to be present in the audio signal before the VAD considers it speech (in seconds). - Range: 0.0 .. 1.0 + Range: 0.0 to 1.0 Default (SDK): 0.0s - sensitivity: Controls the energy threshold sensitivity. Higher values make the detector less sensitive (require more energy to count as speech). - Range: 1.0 .. 15.0 + Range: 1.0 to 15.0 Formula: Energy threshold = 10 ** (-sensitivity) Default (SDK): 6.0 @@ -61,16 +61,16 @@ class AICVADAnalyzer(VADAnalyzer): will retry on set_sample_rate/first use. speech_hold_duration: Optional override for AIC VAD speech hold duration (in seconds). - Range: 0.0 .. 20x model window length. + Range: 0.0 to 20x model window length. If None, the SDK default (0.05s) is used. minimum_speech_duration: Optional override for minimum speech duration before VAD reports speech detected (in seconds). - Range: 0.0 .. 20x model window length. + Range: 0.0 to 20x model window length. If None, the SDK default (0.0s) is used. sensitivity: Optional override for AIC VAD sensitivity (energy threshold). - Range: 1.0 .. 15.0. Energy threshold = 10 ** (-sensitivity). + Range: 1.0 to 15.0. Energy threshold = 10 ** (-sensitivity). If None, the SDK default (6.0) is used. """ # Use fixed VAD parameters for AIC: no user override