Skip to content

Commit

Permalink
Move STT timing to start at recording end (#199)
Browse files Browse the repository at this point in the history
# Description
This makes interactions with the listener more directly comparable with
API inputs by timing the same parts of the code.

# Issues
<!-- If this is related to or closes an issue/other PR, please note them
here -->

# Other Notes
More consistent with [the
docs](https://github.com/NeonGeckoCom/neon-docs/pull/30/files)

---------

Co-authored-by: Daniel McKnight <[email protected]>
  • Loading branch information
NeonDaniel and NeonDaniel authored May 14, 2024
1 parent def7415 commit e0abed4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions neon_speech/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
from tempfile import mkstemp
from threading import Lock, Event
from time import time

from pydub import AudioSegment
from speech_recognition import AudioData
from neon_utils.file_utils import decode_base64_string_to_file
Expand Down Expand Up @@ -135,9 +136,9 @@ def __init__(self, ready_hook=on_ready, error_hook=on_error,
LOG.info("Skipping api_stt init")
self.api_stt = None

def _record_begin(self):
def _record_end_signal(self):
self._stt_stopwatch.start()
OVOSDinkumVoiceService._record_begin(self)
OVOSDinkumVoiceService._record_end_signal(self)

def _stt_text(self, text: str, stt_context: dict):
self._stt_stopwatch.stop()
Expand Down

0 comments on commit e0abed4

Please sign in to comment.