Aug-03-2020, 09:01 PM
(This post was last modified: Aug-03-2020, 09:01 PM by glittergirl.)
I am following this tutorial to transcribe audio.
First, I installed all the modules and program before running
I also checked the following:
First, I installed all the modules and program before running
python3 transcribe.py
, and transcribe.py contains the following code.import speech_recognition as sr from os import path from pydub import AudioSegment # convert mp3 file to wav sound = AudioSegment.from_mp3("transcript.mp3") sound.export("transcript.wav", format="wav") # transcribe audio file AUDIO_FILE = "transcript.wav" # 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 print("Transcription: " + r.recognize_google(audio))When I run the
python3 transcribe.py
line in my terminal, I get the following error:Error:]Traceback (most recent call last):
File "transcribe.py", line 1, in <module>
import speech_recognition as sr
ImportError: No module named speech_recognition
I checked whether SpeechRecognition was properly installed using pip3 list
, and it shows up on nthe list.I also checked the following:
Output:pip3 install --upgrade speechrecognition
Requirement already up-to-date: speechrecognition in /usr/local/lib/python3.8/site-packages (3.8.1)
In any case, any help will be appreciated! Thanks!