From e0abed41a787362781c8d17ac2047ff66b37a582 Mon Sep 17 00:00:00 2001 From: Daniel McKnight <34697904+NeonDaniel@users.noreply.github.com> Date: Tue, 14 May 2024 10:06:32 -0700 Subject: [PATCH] Move STT timing to start at recording end (#199) # Description This makes interactions with the listener more directly comparable with API inputs by timing the same parts of the code. # Issues # Other Notes More consistent with [the docs](https://github.com/NeonGeckoCom/neon-docs/pull/30/files) --------- Co-authored-by: Daniel McKnight --- neon_speech/service.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/neon_speech/service.py b/neon_speech/service.py index 92199a1..c8ddc9d 100644 --- a/neon_speech/service.py +++ b/neon_speech/service.py @@ -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 @@ -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()