I have seen the documentation of pyspeech and dragonfly, but don't know how to input an audio file to be converted into text. I have tried it with microphone via speaking to it and the speech is converted into text, but If I want to input a previously recorded audio file. Can anyone help with an example?
Asked
Active
Viewed 2,040 times
3
-
I've seen this asked a few times, but never seen a solid answer. http://stackoverflow.com/questions/9404099/python-speech-compare may be helpful. – Michael Levy Sep 17 '12 at 15:25
2 Answers
0
Both PySpeech and Dragonfly are relatively thin wrappers over SAPI. Unfortunately, both of them use the shared recognizer, which doesn't support input selection. While I'm familiar with SAPI, I'm not that familiar with Python, so I haven't been able to assist anyone with moving PySpeech/Dragonfly over to an in-process recognizer.

Eric Brown
- 13,774
- 7
- 30
- 71
0
import speech_recognition as sr
print(sr.__version__)
r = sr.Recognizer()
audio_file = sr.AudioFile('audio_file.wav')
with audio_file as source:
audio = r.record(source)
print(type(audio))
print(r.recognize_google(audio))

kamran kausar
- 4,117
- 1
- 23
- 17