1

hi i have a code that recognizes my voice and prints it in python shell.

now i want it to print text in the selected text box , what should i do?

code is :

import speech_recognition as sr


def start():
    r = sr.Recognizer()
    with sr.Microphone() as source:
        print("listening started")
        audio = r.listen(source)

    WIT_AI_KEY = "what ever"
    try:
        print("Wit.ai thinks you said " + r.recognize_wit(audio, key=WIT_AI_KEY))
    except sr.UnknownValueError:
        print("Wit.ai could not understand audio")
    except sr.RequestError as e:
        print("Could not request results from Wit.ai service; {0}".format(e))
    start()
start()
Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358
mzage
  • 278
  • 1
  • 3
  • 12

0 Answers0