Skip to content

Commit

Permalink
Update silero_vad.py
Browse files Browse the repository at this point in the history
  • Loading branch information
HarryHe11 authored Jul 5, 2024
1 parent dbfe7a3 commit 3927074
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions preprocessors/Emilia/models/silero_vad.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import torch
import numpy as np


VAD_THRESHOLD = 20
SAMPLING_RATE = 16000


Expand Down Expand Up @@ -122,7 +122,6 @@ def vad(self, speakerdia, audio):
Returns:
list: A list of dictionaries containing processed audio segments with start, end, and speaker.
"""
SAMPLING_RATE_THRESHOLD = 20
sampling_rate = audio["sample_rate"]
audio_data = audio["waveform"]

Expand All @@ -144,7 +143,7 @@ def vad(self, speakerdia, audio):
if row["speaker"] not in speakers_seen:
speakers_seen.add(row["speaker"])

if end - start <= SAMPLING_RATE_THRESHOLD:
if end - start <= VAD_THRESHOLD:
out.append(
{
"index": str(count_id).zfill(5),
Expand Down

0 comments on commit 3927074

Please sign in to comment.