emonet.batch_vad module
emonet.batch_vad module#
Module to apply pre-train VAD model to files.
Intended to run as batch process before any training begins.
- class emonet.batch_vad.VadChunk(model: torch.nn.modules.module.Module, sample_rate: int = 16000)[source]#
Bases:
object
Class for applying pre-trained VAD model to audio file.
Constructor method.
- Parameters
model (nn.Module) – Pre-trained voiced activity detection (VAD) model.
sample_rate (int) – Sample rate of audio file.
- __init__(model: torch.nn.modules.module.Module, sample_rate: int = 16000)[source]#
Constructor method.
- Parameters
model (nn.Module) – Pre-trained voiced activity detection (VAD) model.
sample_rate (int) – Sample rate of audio file.
- get(x: torch.Tensor, filename: pathlib.Path) torch.Tensor [source]#
Get speech chunks consolidated into single tensor.
- Parameters
x (torch.Tensor) – Original audio signal.
filename (pathlib.Path) – Filename containing original audio for tensor x.
- Returns
torch.Tensor – VAD chunks consolidated into single tensor.