Reputation: 35636
I'm trying to transcribe an audio file which is bit large. It's properties are as follows.
Size : 278.3 MB
Duration : 52 minutes
Format : WAV
Follwoing is my code which I used to convert it having 60 second durations. Could you please advice to transcribe this file at once?
import speech_recognition as sr
r = sr.Recognizer()
with sr.AudioFile('sampleMp3.WAV') as source:
audio = r.record(source, duration=60)
command = r.recognize_google(audio)
text_file = open("Output.txt", "w")
text_file.write(command)
text_file.close()
Upvotes: 5
Views: 5707
Reputation: 25210
speech_recognition python package is just a wrapper, it does not provide even basic functions.
If you want to use Google Speech API (paid), you can do something like this:
If you want to consider Bing, it also provides similar API, see How can I transcribe a speech file with the Bing Speech API in Python?
For the free alternative consider https://github.com/alumae/kaldi-offline-transcriber
Upvotes: 3