feature request: voice activity detection
- Vorherrschende Sprache
- Jupyter Notebook
- Sterne
- 15.1k
- Forks
- 1.8k
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
I want to end speech recognition and call FinalResult() when silence last longer than a timeout parameter.
The pocketsphinx-python lib has a [get_in_speech()](https://github.com/bambocher/pocketsphinx-python/blob/master/pocketsphinx/__init__.py#L218) function which seems to be doing the VAD thing, maybe we can implement similar function.
[python psudo code]:
```
def fun(recognizer, stream, timeout):
no_speech_count = 0
while True:
if recognizer.AcceptWaveform(stream.read(4000)):
return recognizer.Result()
elif not recognizer.get_in_speech():
no_speech_count += 4000 / samplerate / channels
if no_speech_count > timeout:
return recognizer.FinalResult()
```
I notice there is a private function [UpdateSilenceWeights](https://github.com/alphacep/vosk-api/blob/master/src/kaldi_recognizer.h#L56), I don't know if it's related to voice activity detection.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Bewertung
Dieses Issue wurde noch nicht bewertet.