how to search on wikipedia with speech recognition and speak the result with python
import wikipedia
import pyttsx3
import speech_recognition as sr
recognizer = sr.Recognizer()
microphone = sr.Microphone()
with microphone as source:
print("plz speak...")
a = recognizer.adjust_for_ambient_noise(source)
audio = recognizer.listen(source)
response = recognizer.recognize_google(audio).lower()
word = response
result = wikipedia.summary(word)
print(result)
pyttsx3.speak(result)