alphacep / alphacep/vosk-api

feature request: voice activity detection

Aperta
#184 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Jupyter Notebook
Stelle
15.1k
Fork
1.8k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.