Skip to content

Commit

Permalink
feat/improve_legacy_support
Browse files Browse the repository at this point in the history
better readme + expose ocp flag to config
  • Loading branch information
JarbasAl committed May 9, 2024
1 parent 8e9cd4b commit 475872d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 11 deletions.
31 changes: 21 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,11 @@ under mycroft.conf
{

// Text to Speech parameters
// Override: REMOTE
"tts": {
"pulse_duck": false,
"module": "ovos-tts-plugin-mimic3-server",
"module": "ovos-tts-plugin-server",
"fallback_module": "ovos-tts-plugin-mimic",
"ovos-tts-plugin-mimic": {
"voice": "ap"
},
"ovos-tts-plugin-mimic3-server": {
"voice": "en_UK/apope_low"
}
},

Expand All @@ -42,15 +37,31 @@ under mycroft.conf
},

// Mechanism used to play WAV audio files
// Override: SYSTEM
"play_wav_cmdline": "paplay %1 --stream-name=mycroft-voice",

// Mechanism used to play MP3 audio files
// Override: SYSTEM
"play_mp3_cmdline": "mpg123 %1",

// Mechanism used to play OGG audio files
// Override: SYSTEM
"play_ogg_cmdline": "ogg123 -q %1"
}
```
```

## Using Legacy AudioService

The legacy audio service supports audio playback via the old mycroft api ([@mycroft](https://github.com/MycroftAI/mycroft-core/blob/dev/mycroft/skills/audioservice.py#L43) [@ovos](https://github.com/OpenVoiceOS/ovos-bus-client/blob/dev/ovos_bus_client/apis/ocp.py#L51))

by default OCP acts as a translation layer for this api and no action is needed, but if you want to disable ocp this api remains available

> **NOTE:** once ovos-media is released OCP and this api will be disabled by default and deprecated!
```javascript
{
"enable_old_audioservice": true,
"disable_ocp": true
}
```

legacy plugins:
- [vlc](https://github.com/OpenVoiceOS/ovos-vlc-plugin)
- [simple](https://github.com/OpenVoiceOS/ovos-audio-plugin-simple) (no https suuport)
4 changes: 3 additions & 1 deletion ovos_audio/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class PlaybackService(Thread):
def __init__(self, ready_hook=on_ready, error_hook=on_error,
stopping_hook=on_stopping, alive_hook=on_alive,
started_hook=on_started, watchdog=lambda: None,
bus=None, disable_ocp=False, validate_source=True):
bus=None, disable_ocp=None, validate_source=True):
super(PlaybackService, self).__init__()

LOG.info("Starting Audio Service")
Expand Down Expand Up @@ -97,6 +97,8 @@ def __init__(self, ready_hook=on_ready, error_hook=on_error,

self.audio = None
self.audio_enabled = self.config.get("enable_old_audioservice", True) # TODO default to False soon
if disable_ocp is None:
disable_ocp = self.config.get("disable_ocp", False) # TODO default to True soon
if self.audio_enabled:
try:
self.audio = AudioService(self.bus, disable_ocp=disable_ocp, validate_source=validate_source)
Expand Down

0 comments on commit 475872d

Please sign in to comment.