Skip to content

Commit

Permalink
Remove deprecated lang arg passed to TTS module init
Browse files Browse the repository at this point in the history
Remove init patch added for debugging
  • Loading branch information
NeonDaniel committed Sep 16, 2024
1 parent ef778e4 commit 846c83b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
3 changes: 1 addition & 2 deletions neon_audio/tts/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,11 @@ def create(config=None):
"en-us")

tts_config = get_tts_config(config)
tts_lang = tts_config["lang"]
clazz = OVOSTTSFactory.get_class(tts_config)
if not clazz:
LOG.error(f"Could not find plugin: {tts_config.get('module')}")
return
tts = WrappedTTS(clazz, tts_lang, tts_config)
tts = WrappedTTS(clazz, config=tts_config)
tts.validator.validate()
LOG.info(f"Initialized tts: {tts.tts_name}")
return tts
19 changes: 1 addition & 18 deletions neon_audio/tts/neon.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import os

from os.path import dirname
from threading import Thread, Event
from time import time

from json_database import JsonStorageXDG
Expand Down Expand Up @@ -154,22 +153,7 @@ def _sort_timing_metrics(timings: dict) -> dict:
class NeonPlaybackThread(PlaybackThread):
def __init__(self, queue, bus=None):
LOG.info("Initializing NeonPlaybackThread")
try:
PlaybackThread.__init__(self, queue, bus=bus)
except TypeError:
LOG.error("Failed to call PlaybackThread init; patching...")
from ovos_audio.transformers import TTSTransformersService
Thread.__init__(self, daemon=True)
self.queue = queue or TTS.queue
self._terminated = False
self._processing_queue = False
self._do_playback = Event()
self.enclosure = None
self.p = None
self.bus = bus or None
self._now_playing = None
self._started = Event()
self.tts_transform = TTSTransformersService(self.bus)
PlaybackThread.__init__(self, queue, bus=bus)

def begin_audio(self, message: Message = None):
# TODO: Mark signals for deprecation
Expand Down Expand Up @@ -332,7 +316,6 @@ def get_multiple_tts(self, message, **kwargs) -> dict:
for request in tts_requested:
tts_lang = kwargs["lang"] = request["language"]
# Check if requested tts lang matches internal (text) lang
# TODO: `self.lang` should come from the incoming message
if tts_lang.split("-")[0] != skill_lang.split("-")[0]:
self.cached_translations.setdefault(tts_lang, {})

Expand Down

0 comments on commit 846c83b

Please sign in to comment.