Skip to content

Commit

Permalink
✨ feat: Made time sensible stt work
Browse files Browse the repository at this point in the history
  • Loading branch information
luisffee committed Nov 5, 2024
1 parent 0b32ea2 commit 4e473d8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions nodes/speech_recognizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,12 @@ def handle_recognition(req):

def check_vad_time(recorder):
while True:
if vad_start_time[0] is not None and (time.time() - vad_start_time[0]) > 10:
recorder.set_microphone(False)
seconds_pass = (time.time() - vad_start_time[0])
if vad_start_time[0] is not None and seconds_pass > 8:
print(colored(f"Stopping listening, too long...{seconds_pass:.1f}s ","red"))
recorder.stop()
break
time.sleep(1)
time.sleep(0.1)

# Update the configurations with additional parameters
configs.update({
Expand Down

0 comments on commit 4e473d8

Please sign in to comment.