diart.blocks.vad#
Module Contents#
Classes#
Configuration containing the required |
|
Represents a streaming audio pipeline |
- class diart.blocks.vad.VoiceActivityDetectionConfig(segmentation=None, duration=5, step=0.5, latency=None, tau_active=0.6, device=None, sample_rate=16000, **kwargs)#
Bases:
diart.blocks.base.PipelineConfigConfiguration containing the required parameters to build and run a pipeline
- Parameters:
segmentation (diart.models.SegmentationModel | None) –
duration (float) –
step (float) –
latency (float | typing_extensions.Literal[max, min] | None) –
tau_active (float) –
device (torch.device | None) –
sample_rate (int) –
- property duration: float#
The duration of an input audio chunk (in seconds)
- Return type:
float
- property step: float#
The step between two consecutive input audio chunks (in seconds)
- Return type:
float
- property latency: float#
The algorithmic latency of the pipeline (in seconds). At time t of the audio stream, the pipeline will output predictions for time t - latency.
- Return type:
float
- property sample_rate: int#
The sample rate of the input audio stream
- Return type:
int
- class diart.blocks.vad.VoiceActivityDetection(config=None)#
Bases:
diart.blocks.base.PipelineRepresents a streaming audio pipeline
- Parameters:
config (VoiceActivityDetectionConfig | None) –
- property config: diart.blocks.base.PipelineConfig#
- Return type:
- static get_config_class()#
- Return type:
type
- static suggest_metric()#
- Return type:
pyannote.metrics.base.BaseMetric
- static hyper_parameters()#
- Return type:
Sequence[diart.blocks.base.HyperParameter]
- reset()#
- set_timestamp_shift(shift)#
- Parameters:
shift (float) –
- __call__(waveforms)#
Runs the next steps of the pipeline given a list of consecutive audio chunks.
- Parameters:
waveforms (Sequence[SlidingWindowFeature]) – Consecutive chunk waveforms for the pipeline to ingest
- Returns:
For each input waveform, a tuple containing the pipeline output and its respective audio
- Return type:
Sequence[Tuple[Any, SlidingWindowFeature]]