Saturday 2 January 2021

Transcribing mp3 to text (python) --> "RIFF id" error

I am trying to turn mp3 file to text, but my code returns the error outlined below. Any help is appreciated!

This is a sample mp3 file. And below is what I have tried:

import speech_recognition as sr
print(sr.__version__)
r = sr.Recognizer()

file_audio = sr.AudioFile(r"C:\Users\Andrew\Podcast.mp3")

with file_audio as source:
    audio_text = r.record(source)

print(type(audio_text))
print(r.recognize_google(audio_text))

The full error I get. Appears to be:

Error: file does not start with RIFF id

Thank you for your help!



from Transcribing mp3 to text (python) --> "RIFF id" error

No comments:

Post a Comment