Skip to content

Commit

Permalink
deprecate:backend client
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Nov 18, 2024
1 parent 744fd1d commit 82a9a7b
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions ovos_dinkum_listener/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@
from ovos_dinkum_listener.voice_loop import DinkumVoiceLoop, ListeningMode, ListeningState
from ovos_dinkum_listener.voice_loop.hotwords import HotwordContainer

try:
from ovos_backend_client.api import DatasetApi
except ImportError:
LOG.info("`ovos-backend-client` is not installed. Upload is disabled")
DatasetApi = None

try:
from ovos_utils.sound import get_sound_duration
Expand Down Expand Up @@ -565,22 +560,6 @@ def _save_ww(self, audio_bytes, ww_meta, save_path=None):
LOG.debug(f"Wrote {wav_path}")
return f"file://{wav_path.absolute()}"

def _upload_hotword(self, wav_data, metadata):
"""Upload the wakeword in a background thread."""

upload_url = Configuration().get("listener", {}).get('wake_word_upload', {}).get('url')

def upload(wav_data, metadata):
DatasetApi().upload_wake_word(wav_data,
metadata,
upload_url=upload_url)

if DatasetApi is not None:
Thread(target=upload, daemon=True,
args=(wav_data, metadata)).start()
else:
LOG.debug("`pip install ovos-backend-client` to enable upload")

@staticmethod
def _compile_ww_context(key_phrase, ww_module):
""" creates metadata in the format expected by selene
Expand Down Expand Up @@ -615,11 +594,6 @@ def _hotword_audio(self, audio_bytes: bytes, ww_context: dict):
if listener["record_wake_words"]:
payload["filename"] = self._save_ww(audio_bytes, ww_context)

upload_disabled = listener.get('wake_word_upload',
{}).get('disable')
if self.config['opt_in'] and not upload_disabled:
self._upload_hotword(audio_bytes, ww_context)

utterance = ww_context.get("utterance")
if utterance:
LOG.debug("Hotword utterance: " + utterance)
Expand Down

0 comments on commit 82a9a7b

Please sign in to comment.