Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update vad.py with more sane speech_pad_ms: int = 4000 #1153

Closed
wants to merge 1 commit into from

Conversation

montvid
Copy link

@montvid montvid commented Nov 19, 2024

In all my tests speech_pad_ms: int = 400 was too small. All other VAD numbers were good. Making speech_pad_ms: int = 4000 2x the min_silence_duration_ms: int = 2000 fixed all my problems. Maybe someone forgot to add another 0?

Here it is doubled too:
https://github.com/jhj0517/Whisper-WebUI/blob/master/configs/default_parameters.yaml
vad:
vad_filter: false
threshold: 0.5
min_speech_duration_ms: 250
max_speech_duration_s: 9999
min_silence_duration_ms: 1000
speech_pad_ms: 2000

In all my tests speech_pad_ms: int = 400 was too small. All other VAD numbers were good. Making speech_pad_ms: int = 4000 2x the min_silence_duration_ms: int = 2000 fixed all my problems.
@MahmoudAshraf97
Copy link
Collaborator

Hello, it doesn't make sense to pad 4s on each side when most silences are less than that, the padding here is to account for slight segment boundaries inacccuracies i.e. not to cut a word in the middle, if 4000 works the best for you, then I guess turning the VAD off completely might be a better solution.
Anyways, I'm not in favor of changing the default value, users have the option to change it if their own use cases need it

@montvid
Copy link
Author

montvid commented Nov 19, 2024

Thank you for the explanation. I checked my transcription and indeed it has sometimes 1 word or 1 sentence missing. A major headache how to adjust the VAD :(

@montvid montvid closed this Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants