Bug fixes for application hanging on Windows.

This commit is contained in:
Jothin-kumar 2021-10-18 23:46:17 +05:30
parent f215476e61
commit 2896c4d167
2 changed files with 22 additions and 19 deletions

View File

@ -4,27 +4,27 @@ import os # isort: skip
import gui # isort: skip import gui # isort: skip
import speech_recognition as sr # isort: skip import speech_recognition as sr # isort: skip
from actions import ( # isort: skip from actions import ( # isort: skip
change_rate, change_rate,
change_voice, change_voice,
change_volume, change_volume,
search_engine_selector, search_engine_selector,
set_gui_speak, set_gui_speak,
speak, speak,
wish_me wish_me
) )
from commands import ( # isort: skip from commands import ( # isort: skip
command_bye, command_bye,
command_hello, command_hello,
command_mail, command_mail,
command_nothing, command_nothing,
command_open, command_open,
command_pause_music, command_pause_music,
command_play_music, command_play_music,
command_search, command_search,
command_stop_music, command_stop_music,
command_unpause_music, command_unpause_music,
command_whatsup, command_whatsup,
command_wikipedia command_wikipedia
) )
popular_websites = { popular_websites = {
@ -86,6 +86,7 @@ def main(search_engine, take_command, debug):
change_volume(query, take_command) change_volume(query, take_command)
speak("Next Command! Sir!") speak("Next Command! Sir!")
gui.set_speak_command(execute_the_command_said_by_user) gui.set_speak_command(execute_the_command_said_by_user)
set_gui_speak(gui.speak) set_gui_speak(gui.speak)
gui.mainloop() gui.mainloop()
@ -107,6 +108,7 @@ def run():
with sr.Microphone() as source: with sr.Microphone() as source:
print("Listening....") print("Listening....")
r.pause_threshold = 0.5 r.pause_threshold = 0.5
r.energy_threshold = int(config['DEFAULT']['energy_threshold'])
audio = r.listen(source) audio = r.listen(source)
query = " " query = " "

View File

@ -6,6 +6,7 @@ musicpath =
voice = Male voice = Male
rate = 150 rate = 150
volume = 100 volume = 100
energy_threshold = 300
[EMAIL] [EMAIL]
server = smtp.gmail.com server = smtp.gmail.com