Python Forum
Error with SpeechRecognition module
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error with SpeechRecognition module
#1
I am following this tutorial to transcribe audio.

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!
Reply


Messages In This Thread
Error with SpeechRecognition module - by glittergirl - Aug-03-2020, 09:01 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  vlc module error pythonprogrammer 1 2,903 Apr-23-2020, 04:16 AM
Last Post: Larz60+
  Cannot use speechrecognition Please HELP Simurg 1 2,176 Aug-11-2019, 07:12 PM
Last Post: buran
  speechrecognition 3.8.1 aibrain 1 3,370 Apr-07-2018, 02:17 PM
Last Post: wavic
  pyhton error there is no PIL module error help! pokeboss235 1 2,940 Feb-22-2018, 03:03 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020