vad: rename VADAnalyzer arguments
This commit is contained in:
@@ -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/),
|
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).
|
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
|
## [0.0.12] - 2024-05-14
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
@@ -159,7 +165,7 @@ a bit.
|
|||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
- Added project optional dependencies [silero,openai,...].
|
- Added project optional dependencies `[silero,openai,...]`.
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
|||||||
@@ -19,22 +19,22 @@ class VADAnalyzer:
|
|||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
sample_rate,
|
sample_rate: int,
|
||||||
num_channels,
|
num_channels: int,
|
||||||
vad_confidence=0.5,
|
vad_confidence: float = 0.5,
|
||||||
vad_start_s=0.2,
|
vad_start_secs: float = 0.2,
|
||||||
vad_stop_s=0.8):
|
vad_stop_secs: float = 0.8):
|
||||||
self._sample_rate = sample_rate
|
self._sample_rate = sample_rate
|
||||||
self._vad_confidence = vad_confidence
|
self._vad_confidence = vad_confidence
|
||||||
self._vad_start_s = vad_start_s
|
self._vad_start_secs = vad_start_secs
|
||||||
self._vad_stop_s = vad_stop_s
|
self._vad_stop_secs = vad_stop_secs
|
||||||
self._vad_frames = self.num_frames_required()
|
self._vad_frames = self.num_frames_required()
|
||||||
self._vad_frames_num_bytes = self._vad_frames * num_channels * 2
|
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_start_frames = round(self._vad_start_secs / vad_frames_per_sec)
|
||||||
self._vad_stop_frames = round(self._vad_stop_s / vad_frame_s)
|
self._vad_stop_frames = round(self._vad_stop_secs / vad_frames_per_sec)
|
||||||
self._vad_starting_count = 0
|
self._vad_starting_count = 0
|
||||||
self._vad_stopping_count = 0
|
self._vad_stopping_count = 0
|
||||||
self._vad_state: VADState = VADState.QUIET
|
self._vad_state: VADState = VADState.QUIET
|
||||||
|
|||||||
Reference in New Issue
Block a user