def speak(whattosay): print (whattosay) audio_file = "response.mp3" tts = gTTS(text=str(whattosay), lang="en") tts.save(audio_file) playsound(audio_file) os.remove(audio_file)