Skip to content

Instantly share code, notes, and snippets.

@NMZivkovic
Created July 26, 2018 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NMZivkovic/9ce7a07577004f8918ca64886010c4c0 to your computer and use it in GitHub Desktop.
Save NMZivkovic/9ce7a07577004f8918ca64886010c4c0 to your computer and use it in GitHub Desktop.
import speech_recognition as sr
recognizer = sr.Recognizer()
sr.Microphone.list_microphone_names()
mic = sr.Microphone(device_index=1)
with mic as source:
recognizer.adjust_for_ambient_noise(source)
audio = recognizer.listen(source)
recognizer.recognize_google(audio)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment