Skip to content

Commit

Permalink
Fix VAD syntax & add vad handling case
Browse files Browse the repository at this point in the history
  • Loading branch information
jhj0517 committed Oct 30, 2024
1 parent ddbe0b6 commit eec0c16
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions modules/whisper/base_transcription_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,17 @@ def run(self,
speech_pad_ms=vad_params.speech_pad_ms
)

audio, speech_chunks = self.vad.run(
vad_processed, speech_chunks = self.vad.run(
audio=audio,
vad_parameters=vad_options,
progress=progress
)

if vad_processed.size > 0:
audio = vad_processed
else:
vad_params.vad_filter = False

result, elapsed_time = self.transcribe(
audio,
progress,
Expand All @@ -150,7 +155,7 @@ def run(self,
if vad_params.vad_filter:
result = self.vad.restore_speech_timestamps(
segments=result,
speech_chunks=vad_params.speech_chunks,
speech_chunks=speech_chunks,
)

if diarization_params.is_diarize:
Expand Down

0 comments on commit eec0c16

Please sign in to comment.