Skip to content

Commit

Permalink
refactor/drop audio service
Browse files Browse the repository at this point in the history
migration to ovos-media
  • Loading branch information
JarbasAl committed Jan 10, 2024
1 parent 9817cfa commit 27bbed2
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 370 deletions.
5 changes: 3 additions & 2 deletions ovos_audio/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from ovos_audio.service import PlaybackService, on_ready, on_error, on_stopping
from ovos_config.locale import setup_locale
from ovos_utils import wait_for_exit_signal
from ovos_utils.log import init_service_logger
from ovos_utils.process_utils import reset_sigint_handler

from ovos_audio.service import PlaybackService, on_ready, on_error, on_stopping
from ovos_config.locale import setup_locale


def main(ready_hook=on_ready, error_hook=on_error, stopping_hook=on_stopping,
watchdog=lambda: None):
Expand Down
12 changes: 7 additions & 5 deletions ovos_audio/playback.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import random
from ovos_audio.transformers import TTSTransformersService
from ovos_bus_client.message import Message
from ovos_plugin_manager.templates.tts import TTS
from ovos_utils.log import LOG, log_deprecation
from ovos_utils.sound import play_audio
from queue import Empty
from threading import Thread, Event
from time import time

from ovos_utils.log import LOG, log_deprecation
from ovos_utils.sound import play_audio

from ovos_audio.transformers import TTSTransformersService
from ovos_bus_client.message import Message
from ovos_plugin_manager.templates.tts import TTS


class PlaybackThread(Thread):
"""Thread class for playing back tts audio and sending
Expand Down
12 changes: 6 additions & 6 deletions ovos_audio/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@
from tempfile import gettempdir
from threading import Thread, Lock

from ovos_bus_client import Message, MessageBusClient
from ovos_bus_client.session import SessionManager
from ovos_config.config import Configuration
from ovos_plugin_manager.g2p import get_g2p_lang_configs, get_g2p_supported_langs, get_g2p_module_configs
from ovos_plugin_manager.tts import TTS
from ovos_plugin_manager.tts import get_tts_supported_langs, get_tts_lang_configs, get_tts_module_configs
from ovos_utils.file_utils import resolve_resource_file
from ovos_utils.log import LOG
from ovos_utils.metrics import Stopwatch
Expand All @@ -24,6 +18,12 @@
from ovos_audio.transformers import DialogTransformersService
from ovos_audio.tts import TTSFactory
from ovos_audio.utils import report_timing, validate_message_context
from ovos_bus_client import Message, MessageBusClient
from ovos_bus_client.session import SessionManager
from ovos_config.config import Configuration
from ovos_plugin_manager.g2p import get_g2p_lang_configs, get_g2p_supported_langs, get_g2p_module_configs
from ovos_plugin_manager.tts import TTS
from ovos_plugin_manager.tts import get_tts_supported_langs, get_tts_lang_configs, get_tts_module_configs


def on_ready():
Expand Down
8 changes: 5 additions & 3 deletions ovos_audio/transformers.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from typing import Tuple

from ovos_utils.log import LOG

from ovos_bus_client.session import Session, SessionManager
from ovos_config import Configuration
from ovos_plugin_manager.dialog_transformers import find_dialog_transformer_plugins, find_tts_transformer_plugins
from ovos_utils.log import LOG
from typing import Tuple


class DialogTransformersService:
Expand All @@ -20,7 +22,7 @@ def __init__(self, bus, config=None):
def blacklisted_skills(self):
# dialog should NEVER be rewritten if it comes from these skills
return self.config.get("blacklisted_skills",
["skill-ovos-icanhazdadjokes.openvoiceos"] # blacklist jokes by default
["skill-ovos-icanhazdadjokes.openvoiceos"] # blacklist jokes by default
)

def load_plugins(self):
Expand Down
5 changes: 3 additions & 2 deletions ovos_audio/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
#
import time

from ovos_utils.log import deprecated
from ovos_utils.signal import check_for_signal

from ovos_bus_client.send_func import send
from ovos_config import Configuration
from ovos_utils.log import LOG, deprecated
from ovos_utils.signal import check_for_signal


def validate_message_context(message, native_sources=None):
Expand Down
27 changes: 0 additions & 27 deletions test/unittests/services/failing/__init__.py

This file was deleted.

57 changes: 0 additions & 57 deletions test/unittests/services/working/__init__.py

This file was deleted.

Loading

0 comments on commit 27bbed2

Please sign in to comment.