Skip to content

Commit

Permalink
Update transcribe.py
Browse files Browse the repository at this point in the history
provide an early exit in case no voice activity is detected.
  • Loading branch information
hedrergudene authored Sep 16, 2024
1 parent d57c5b4 commit 6a57c52
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions faster_whisper/transcribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,10 @@ def transcribe(
all_language_probs=all_language_probs,
)

# Exit if no activity if found
if duration_after_vad==0:
return [], info

audio_segments, segments_metadata = self.audio_split(
audio, vad_segments, sampling_rate
)
Expand Down

0 comments on commit 6a57c52

Please sign in to comment.