Skip to content

Instantly share code, notes, and snippets.

@NMZivkovic
Created July 26, 2018 19:09
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/710562514f1169fdec5ae47af0c78fb7 to your computer and use it in GitHub Desktop.
Save NMZivkovic/710562514f1169fdec5ae47af0c78fb7 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, language='sr-SP')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment