Skip to content

feature request: voice activity detection #184

@hyansuper

Description

@hyansuper

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() 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, I don't know if it's related to voice activity detection.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions