diff --git a/CHANGELOG.md b/CHANGELOG.md index 27d11b0a6..868c9568c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to **pipecat** will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.0.13] - 2024-05-14 + +### Changed + +- `VADAnalyzer` arguments have been renamed for more clarity. + ## [0.0.12] - 2024-05-14 ### Added @@ -159,7 +165,7 @@ a bit. ### Added -- Added project optional dependencies [silero,openai,...]. +- Added project optional dependencies `[silero,openai,...]`. ### Changed diff --git a/src/pipecat/vad/vad_analyzer.py b/src/pipecat/vad/vad_analyzer.py index a506292e2..58bec3b9a 100644 --- a/src/pipecat/vad/vad_analyzer.py +++ b/src/pipecat/vad/vad_analyzer.py @@ -19,22 +19,22 @@ class VADAnalyzer: def __init__( self, - sample_rate, - num_channels, - vad_confidence=0.5, - vad_start_s=0.2, - vad_stop_s=0.8): + sample_rate: int, + num_channels: int, + vad_confidence: float = 0.5, + vad_start_secs: float = 0.2, + vad_stop_secs: float = 0.8): self._sample_rate = sample_rate self._vad_confidence = vad_confidence - self._vad_start_s = vad_start_s - self._vad_stop_s = vad_stop_s + self._vad_start_secs = vad_start_secs + self._vad_stop_secs = vad_stop_secs self._vad_frames = self.num_frames_required() self._vad_frames_num_bytes = self._vad_frames * num_channels * 2 - vad_frame_s = self._vad_frames / self._sample_rate + vad_frames_per_sec = self._vad_frames / self._sample_rate - self._vad_start_frames = round(self._vad_start_s / vad_frame_s) - self._vad_stop_frames = round(self._vad_stop_s / vad_frame_s) + self._vad_start_frames = round(self._vad_start_secs / vad_frames_per_sec) + self._vad_stop_frames = round(self._vad_stop_secs / vad_frames_per_sec) self._vad_starting_count = 0 self._vad_stopping_count = 0 self._vad_state: VADState = VADState.QUIET