Skip to content

Instantly share code, notes, and snippets.

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 portableant/797812d094b4ca559b4b78e918d03a78 to your computer and use it in GitHub Desktop.
Save portableant/797812d094b4ca559b4b78e918d03a78 to your computer and use it in GitHub Desktop.
import speech_recognition as sr
filename = "2101.wav"
r = sr.Recognizer()
with sr.AudioFile(filename) as source:
# listen for the data (load audio to memory)
audio_data = r.record(source)
# recognize (convert from speech to text)
text = r.recognize_google(audio_data)
print(text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment