I
I
Ivan Noname2018-04-02 15:29:25
linux
Ivan Noname, 2018-04-02 15:29:25

Why doesn't speech recognition work?

import speech_recognition as sr

r = sr.Recognizer()

with sr.Microphone() as source:
    print("Скажите что-нибудь")
    audio = r.listen(source)
    try:
        print(r.recognize_google(audio, language="ru-RU"))
    except sr.UnknownValueError:
        print("Робот не расслышал фразу")
    except sr.RequestError as e:
        print("Ошибка сервиса; {0}".format(e))

This code works fine on Windows but on Linux Mint it hangs waiting after print("Say something"). PyAudio is installed, the microphone is working. SnowBoy perfectly recognizes speech through a microphone, but this piece of code does not want to.
How to fix?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2018-04-02
@vintello

try:осле
Are you seriously ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question