How to fix the below mention error in python

20 views Asked by At
  1. context:- below is my code and It is showing error "import speech_recognition as sr ModuleNotFoundError: No module named 'speech_recognition'"
import os
import time
import playsound
import speech_recognition as sr
from gtts import gTTS
def speak(text):
    tts= gTTS(text=text,lang="en")
    filename="voice.mp3"
    tts.save(filename)
    playsound.playsound(filename)

speak("hello tim")``

I am just making for speech recognition

0

There are 0 answers