From 2896c4d167dcbe3a2f97663d73f5d3a68587c30a Mon Sep 17 00:00:00 2001 From: Jothin-kumar Date: Mon, 18 Oct 2021 23:46:17 +0530 Subject: [PATCH] Bug fixes for application hanging on Windows. --- Jarvis2_4windows.py | 40 +++++++++++++++++++++------------------- config.ini | 1 + 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/Jarvis2_4windows.py b/Jarvis2_4windows.py index 4681632..4b2cda4 100644 --- a/Jarvis2_4windows.py +++ b/Jarvis2_4windows.py @@ -4,27 +4,27 @@ import os # isort: skip import gui # isort: skip import speech_recognition as sr # isort: skip from actions import ( # isort: skip - change_rate, - change_voice, - change_volume, - search_engine_selector, - set_gui_speak, - speak, - wish_me + change_rate, + change_voice, + change_volume, + search_engine_selector, + set_gui_speak, + speak, + wish_me ) from commands import ( # isort: skip - command_bye, - command_hello, - command_mail, - command_nothing, - command_open, - command_pause_music, - command_play_music, - command_search, - command_stop_music, - command_unpause_music, - command_whatsup, - command_wikipedia + command_bye, + command_hello, + command_mail, + command_nothing, + command_open, + command_pause_music, + command_play_music, + command_search, + command_stop_music, + command_unpause_music, + command_whatsup, + command_wikipedia ) popular_websites = { @@ -86,6 +86,7 @@ def main(search_engine, take_command, debug): change_volume(query, take_command) speak("Next Command! Sir!") + gui.set_speak_command(execute_the_command_said_by_user) set_gui_speak(gui.speak) gui.mainloop() @@ -107,6 +108,7 @@ def run(): with sr.Microphone() as source: print("Listening....") r.pause_threshold = 0.5 + r.energy_threshold = int(config['DEFAULT']['energy_threshold']) audio = r.listen(source) query = " " diff --git a/config.ini b/config.ini index 2765b59..17b21c8 100644 --- a/config.ini +++ b/config.ini @@ -6,6 +6,7 @@ musicpath = voice = Male rate = 150 volume = 100 +energy_threshold = 300 [EMAIL] server = smtp.gmail.com