I am trying to write into mp3 file. Then I read the same mp3 and try to transcribe it into text. I keep on getting the following error.
from gtts import gTTS
text = ("Spoken text")
tts = gTTS(text=text, lang='en')
import speech_recognition as sr
AUDIO_FILE = "test.mp3"
# use the audio file as the audio source
r = sr.Recognizer()
with sr.AudioFile(AUDIO_FILE) as source:
audio = r.record(source) # read the entire audio file
ValueError: Audio file could not be read as PCM WAV, AIFF/AIFF-C, or Native FLAC; check if file is corrupted or in another format