From ff44402f7f08c3bf399918a7b5ce6dabaf1850de Mon Sep 17 00:00:00 2001 From: "k.v.vora" <58413260+krupalvora@users.noreply.github.com> Date: Thu, 1 Oct 2020 11:17:21 +0530 Subject: [PATCH] Update __init__.py --- speech_recognition/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/speech_recognition/__init__.py b/speech_recognition/__init__.py index 8eaabf94..db820e93 100644 --- a/speech_recognition/__init__.py +++ b/speech_recognition/__init__.py @@ -21,6 +21,14 @@ import time import uuid +import playsound +# short and simple. +#for audio output. instead of print you can get voice as output +def voice(p): + myobj=gTTS(text=p,lang='en',slow=False) + myobj.save('try.mp3') + playsound('try.mp3') + __author__ = "Anthony Zhang (Uberi)" __version__ = "3.8.1" __license__ = "BSD"