From 371afb6f462d160a234488ee9ea0d33faba5e9fd Mon Sep 17 00:00:00 2001 From: khushmehn <54769322+khushmehn@users.noreply.github.com> Date: Thu, 7 Oct 2021 21:25:45 +0530 Subject: [PATCH] Create Speech_to_text.py --- Speech_to_text.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Speech_to_text.py diff --git a/Speech_to_text.py b/Speech_to_text.py new file mode 100644 index 0000000..21d27e9 --- /dev/null +++ b/Speech_to_text.py @@ -0,0 +1,18 @@ +import pyttsx3 +import speech_recognition as sr + +def get(): + r = sr.Recognizer() + with sr.Microphone() as source: + print('Say Something...!') + audio = r.listen(source) + print('done!') + + try: + text = r.recognize_google(audio) + print("You Said, "+ text) + + except Exception as e: + print(e) + +get()