Skip to content

Commit

Permalink
Clean up changes to reduce diff
Browse files Browse the repository at this point in the history
  • Loading branch information
NeonDaniel committed Feb 12, 2025
1 parent e06b69c commit 75e8076
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions neon_audio/tts/neon.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,8 @@ def _init_playback(self, playback_thread: NeonPlaybackThread = None):
LOG.exception("Error starting the playback thread")

def _get_tts(self, sentence: str, request: dict = None, **kwargs):
# TODO: Signature should be made to match ovos-audio
log_deprecation("This method is deprecated without replacement",
"1.6.0")
if any([x in inspect.signature(self.get_tts).parameters
for x in {"speaker", "wav_file"}]):
LOG.info(f"Legacy Neon TTS signature found ({self.__class__.__name__})")
Expand All @@ -294,7 +295,6 @@ def _get_tts(self, sentence: str, request: dict = None, **kwargs):
os.makedirs(dirname(file), exist_ok=True)
if os.path.isfile(file):
LOG.info(f"Using cached TTS audio")
# TODO: In this case, playback is not reported properly
return file, None
plugin_kwargs = dict()
if "speaker" in inspect.signature(self.get_tts).parameters:
Expand Down Expand Up @@ -421,11 +421,8 @@ def execute(self, sentence: str, ident: str = None, listen: bool = False,
vis = self.viseme(r["phonemes"]) if r["phonemes"] \
else None
# queue for playback
LOG.debug(f"Queue playback of: {wav_file} in "
f"queue={self.queue}")
element = (wav_file, vis, listen, ident, message)
LOG.debug(f"Queue element={element}")
self.queue.put(element)
LOG.debug(f"Queue playback of: {wav_file}")
self.queue.put((wav_file, vis, listen, ident, message))
self.handle_metric({"metric_type": "tts.queued"})
else:
LOG.warning(f'no Message associated with TTS request: {ident}')
Expand Down

0 comments on commit 75e8076

Please sign in to comment.