I have question ABOUT PYTHON.
Whenever I am importing ‘speak’ module in python it showing me an error 'Unable to import ‘speak’
However, I’ve already done:
pip install Speech_recognition pip install requests
Is ‘speak’ a module in python? if yes, then how can I import it in python. I have already asked this query on stack overflow but no one gives me the solution
Give me the possible solution.
import requests
from bs4 import BeautifulSoup
import speech_recognition as sr
import speak # This 'speak' module is giving me the error.
r = sr.Recognizer()
sr.Microphone() as source:
print ('Say')
audio = r.listen(source)
print ('okay!')
say_text = r.recognize_google(audio)
url = "https://www.google.co.in/search?q=" + say_text
response = requests.get(url)
soup = BeautifulSoup(response.text, "lxml")
for item in soup.select(".r a"):
speak.tts(item.text, 'en')
print(item.text)