alphacep / alphacep/vosk-api

feature request: voice activity detection

未关闭
#184 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Jupyter Notebook
星标
15.1k
派生
1.8k
PR 合并指标
30 天内没有已合并 PR

描述

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.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。