G
G
GRIMSHOT2022-02-14 15:25:14
Python
GRIMSHOT, 2022-02-14 15:25:14

Condition: if text vosk is not recognized, how to implement?

If someone worked with the vosk library, tell me how to make an unrecognized text condition, as in speech_recognition
Here is the code

while True:
        data = stream.read(4000, exception_on_overflow=False)
        if (rec.AcceptWaveform (data)) and (len(data) > 0):
            voice = json.loads (rec.Result())
            if voice['text']:
                aud = voice['text']
                yield voice['text']
for text in listen():
        if text in cmd['names']:
            sound()

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question