Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OVOS Dinkum Listener Backwards Compat #178

Merged
merged 10 commits into from
Oct 26, 2023
11 changes: 10 additions & 1 deletion neon_speech/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
from pydub import AudioSegment
from speech_recognition import AudioData
from neon_utils.file_utils import decode_base64_string_to_file
from ovos_utils.log import LOG
from ovos_utils.log import LOG, log_deprecation
from neon_utils.configuration_utils import get_neon_user_config
from neon_utils.metrics_utils import Stopwatch
from neon_utils.user_utils import apply_local_user_profile_updates
Expand Down Expand Up @@ -133,6 +133,15 @@ def __init__(self, ready_hook=on_ready, error_hook=on_error,
LOG.info("Skipping api_stt init")
self.api_stt = None

def _validate_message_context(self, message: Message, native_sources=None):
if message.context.get('destination') and \
"audio" not in message.context['destination']:
log_deprecation(f"Adding audio to destination context for "
f"{message.msg_type}", "5.0.0")
message.context['destination'].append('audio')
return OVOSDinkumVoiceService._validate_message_context(self, message,
native_sources)

def run(self):
if self.config.get('listener', {}).get('enable_voice_loop', True):
OVOSDinkumVoiceService.run(self)
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ovos-dinkum-listener~=0.0.2,>=0.0.3a16
ovos-dinkum-listener==0.0.3a16
ovos-bus-client~=0.0.3
ovos-utils~=0.0.30
ovos-plugin-manager~=0.0.23
Expand Down
Loading