Skip to content

Commit

Permalink
Update for latest ovos-audio compat. (#172)
Browse files Browse the repository at this point in the history
# Description
Update for compat with latest ovos-audio alpha release

# Issues
Needed for NeonGeckoCom/NeonCore#641

# Other Notes
<!-- Note any breaking changes, WIP changes, requests for input, etc.
here -->

---------

Co-authored-by: Daniel McKnight <[email protected]>
  • Loading branch information
NeonDaniel and NeonDaniel authored May 8, 2024
1 parent dc55b20 commit 0201290
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
3 changes: 2 additions & 1 deletion neon_audio/tts/neon.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ def _init_playback(self, playback_thread: NeonPlaybackThread = None):
init_signal_bus(self.bus)
TTS.playback = playback_thread or NeonPlaybackThread(TTS.queue)
TTS.playback.set_bus(self.bus)
TTS.playback.attach_tts(self)
if hasattr(TTS.playback, "attach_tts"):
TTS.playback.attach_tts(self)
if not TTS.playback.enclosure:
TTS.playback.enclosure = EnclosureAPI(self.bus)
if not TTS.playback.is_alive():
Expand Down
5 changes: 3 additions & 2 deletions requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
ovos-audio~=0.0.2a38
ovos-audio~=0.0.2a42
ovos-utils>=0.0.35,<0.2.0
ovos-config~=0.0.10
phoneme-guesser~=0.1
ovos-plugin-manager~=0.0.24
# TODO: Alpha patching ovos-audio dependency resolution
ovos-plugin-manager~=0.0.24,>=0.0.26a16
neon-utils[network]~=1.9
click~=8.0
click-default-group~=1.2
Expand Down
9 changes: 5 additions & 4 deletions tests/unit_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
from time import time
from os.path import join, dirname
from threading import Event
from unittest import skip
from unittest.mock import Mock, patch
from click.testing import CliRunner
from ovos_bus_client import Message
Expand Down Expand Up @@ -119,6 +120,7 @@ def test_validate_ssml(self):
self.assertEqual(valid_tag_string, self.tts.validate_ssml(valid_tag_string))
self.assertEqual(valid_tag_string, self.tts.validate_ssml(extra_tags_string))

@skip("Method deprecated in ovos-audio")
def test_preprocess_sentence(self):
# TODO: Legacy
sentence = "this is a test"
Expand Down Expand Up @@ -170,10 +172,9 @@ def test_validator_valid(self):
self.assertTrue(self.tts.validator.validate_dependencies())
self.assertTrue(self.tts.validator.validate_connection())

@patch("ovos_plugin_manager.templates.tts.Configuration")
def test_validator_invalid(self, config):
config.return_value = self.config # Explicitly no g2p
tts = DummyTTS("es", {})
def test_validator_invalid(self):
tts = DummyTTS("", {})
tts.validator.validate_lang = Mock(side_effect=Exception("Validation Error"))

with self.assertRaises(Exception):
tts.validator.validate()
Expand Down

0 comments on commit 0201290

Please sign in to comment.