Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Type with Microphone with Python
import speech_recognition as sr
from pyautogui import press, typewrite, hotkey
r = sr.Recognizer()
with sr.Microphone() as source:
while True:
try:
audio = r.listen(source)
result = r.recognize_google(audio,language="pt-BR")
typewrite(result)
except:
print ("Eu nao entendi")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment