#If you use windows you can install win32com.client using the command pip
#install pypiwin and then pip install win32com
from win32com.client import Dispatch
s = Dispatch('Sapi.SpVoice')
s.speak('Whatever you would want your code to speak')
import speech_recognition as sr
def mycommand():
r = sr.Recognizer()
with sr.Microphone() as source:
print("listening....")
r.pause_threshold = 1
audio = r.listen(source)
query = mycommand()
print(query)
#prints whatever you said