Skip to content

Commit

Permalink
Move timer reset to ensure minimum recording length is measured from …
Browse files Browse the repository at this point in the history
…the moment input is accepted

Related to #107
Related to #110
  • Loading branch information
NeonDaniel committed Apr 25, 2024
1 parent 1e5aa2e commit ba73782
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ovos_dinkum_listener/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,8 @@ def run(self):
while not self._stopping:
if not self._reload_event.wait(30):
raise TimeoutError("Timed out waiting for reload")
# Run the voice_loop until it is stopped; if the voice service
# isn't stopped, re-run the voice_loop any time it stops
self.voice_loop.run()
except KeyboardInterrupt:
LOG.info("Exit via CTRL+C")
Expand Down Expand Up @@ -773,7 +775,6 @@ def _handle_listen(self, message: Message):
if self.voice_loop.wake_callback is not None:
# Emit `recognizer_loop:record_begin`
self.voice_loop.wake_callback()
self.voice_loop.reset_speech_timer()
self.voice_loop.stt_audio_bytes = bytes()
self.voice_loop.stt.stream_start()
if self.voice_loop.fallback_stt is not None:
Expand All @@ -796,6 +797,7 @@ def _handle_listen(self, message: Message):
self.voice_loop.state = ListeningState.BEFORE_COMMAND
else:
self.voice_loop.state = ListeningState.BEFORE_COMMAND
self.voice_loop.reset_speech_timer()

def _handle_mic_get_status(self, message: Message):
"""Query microphone mute status."""
Expand Down

0 comments on commit ba73782

Please sign in to comment.