I'm trying to break an audio file into small subsections, and then perform speech recognition on each small subsection. To do this, I am splitting the file up using PyDub, and hoping to input it into the SpeechRecognition library. However, I want to do this without needing to save each small audio chunk to disk, and then re-read it. Hence, I want to do an in-memory conversion from the PyDub.AudioSegment object to a speech_recognition.AudioData object.
Is there any way to do this?
(I'm looking for a similar end result to this question)
I've already got the original audio split into segments, and stored in a list.