I'm just trying to simply get a transcript from an audio file using python SpeechRecognition. It seems like no matter what pause_threshold I set, or duration or whatever, it always gives me the same exact output, approximately 30 seconds out of 80 seconds audio, and then it cuts off.
import speech_recognition as sr
import moviepy.editor as mp
clip = mp.VideoFileClip(r"recording2.webm")
clip.audio.write_audiofile(r"converted.wav")
r = sr.Recognizer()
r.pause_threshold = 10
# r.energy_threshold = 4000
audio = sr.AudioFile("converted.wav")
with audio as source:
audio_file = r.record(source, duration=90)
result = r.recognize_azure(audio_file, key=AZUREKEY, language="en-US", show_all=False, location="westeurope")
print(result)
No matter how I set up, still has the same result.