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()
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:
https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/speech/cloud-client/transcribe_async.py
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With