Transcribe speech to text with Python or the Web Speech API:
Make sure you have Python installed:
$ python --version
Python version 3 is recommended.
$ pip install SpeechRecognition
speech_to_text.py that transcribes audio file
Hello World.wav to text:
# speech_to_text.py import speech_recognition as sr r = sr.Recognizer() filename = "Hello World.wav" with sr.AudioFile(filename) as source: audio = r.listen(source) text = r.recognize_google(audio) print(text)
$ python speech_to_text.py hello world
SpeechRecognition supports the following engines/API’s:
|Free||API limitations (e.g., network timeout, file too big, rate limiting)|
|Fairly accurate||Transcript can be off|
|No punctuation marks|
See guide for more details.
See GitHub repository for more details.