I am making a voice assistant and when I say "set alarm" program freezing and waiting for time that alarm set. So I can't talk to the assistant until alarm plays.
Here is the code
if 'alarm' in said:
engine.say('Set')
engine.runAndWait()
now = datetime.datetime.now()
alarm_time = datetime.datetime.combine(now.date(), datetime.time(int(said)))
time.sleep((alarm_time - now).total_seconds())
os.system("start alarm.mp3")
How to ignore it or make something to the program so it won't freeze? Maybe there are other ways for setting alarm?
Help will be appreciated!