You've already forked STARK
mirror of
https://github.com/MarkParker5/STARK.git
synced 2025-07-12 22:50:22 +02:00
small fix
This commit is contained in:
@ -15,8 +15,11 @@ class SpeechToText:
|
||||
this.r.dynamic_energy_threshold = False
|
||||
|
||||
def listen(this):
|
||||
with this.m as source:
|
||||
audio = this.r.listen(source)
|
||||
try:
|
||||
with this.m as source:
|
||||
audio = this.r.listen(source)
|
||||
except:
|
||||
return ''
|
||||
try:
|
||||
responce = {'text': this.r.recognize_google(audio, language = this.language).lower(), 'status': 'ok'}
|
||||
except sr.UnknownValueError:
|
||||
|
@ -18,7 +18,7 @@ if config.double_clap_activation:
|
||||
# check double clap from arduino microphone module
|
||||
def checkClap(channel):
|
||||
global lastClapTime
|
||||
global doubleClapw
|
||||
global doubleClap
|
||||
now = time.time()
|
||||
delta = now - lastClapTime
|
||||
if 0.1 < delta < 0.6:
|
||||
@ -75,7 +75,7 @@ while True: # main loop
|
||||
if Command.isRepeat(text):
|
||||
reply(memory[0]['responce']);
|
||||
continue
|
||||
# recognize command with context
|
||||
# trying to recognize command with context
|
||||
try:
|
||||
cmd, params = memory[0]['cmd'].checkContext(text).values()
|
||||
if memory[0].get('params'): params = {**memory[0].get('params'), **params}
|
||||
|
Reference in New Issue
Block a user