Skip to content

Instantly share code, notes, and snippets.

@admond1994
Created June 22, 2019 06:11
Show Gist options
  • Select an option

  • Save admond1994/850e9c48d8729754217d684165cd19d9 to your computer and use it in GitHub Desktop.

Select an option

Save admond1994/850e9c48d8729754217d684165cd19d9 to your computer and use it in GitHub Desktop.
if __name__ == "__main__":
recognizer = sr.Recognizer()
mic = sr.Microphone(device_index=1)
response = recognize_speech_from_mic(recognizer, mic)
print('\nSuccess : {}\nError : {}\n\nText from Speech\n{}\n\n{}' \
.format(response['success'],
response['error'],
'-'*17,
response['transcription']))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment