Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Commit

Permalink
Update for ovos-utils 0.1 Compat (#27)
Browse files Browse the repository at this point in the history
Update references to support ovos-utils 0.1

Co-authored-by: Daniel McKnight <[email protected]>
  • Loading branch information
NeonDaniel and NeonDaniel authored Apr 25, 2024
1 parent f16cc94 commit 26a5600
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
12 changes: 8 additions & 4 deletions ovos_listener/mic.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
from ovos_utils.log import LOG
from ovos_utils.messagebus import get_message_lang
from ovos_utils.signal import check_for_signal, get_ipc_directory
from ovos_utils.sound import play_audio, play_listening_sound, play_end_listening_sound
from ovos_utils.sound import play_audio
from speech_recognition import (
Microphone,
AudioSource,
Expand Down Expand Up @@ -673,7 +673,9 @@ def trigger_listen(self):
LOG.info('Listen triggered from external source.')
self._listen_triggered = True
if self.config.get("confirm_listening"):
play_listening_sound()
sound = self.config.get("sounds", {}).get("start_listening")
if sound:
play_audio(resolve_resource_file(sound))

def _upload_hotword(self, audio, metadata):
"""Upload the wakeword in a background thread."""
Expand Down Expand Up @@ -747,7 +749,7 @@ def _handle_hotword_found(self, hotword, audio_data, source):
# indicate hotword was detected.
if sound:
try:
sound = resolve_resource_file(sound)
sound = resolve_resource_file(sound, config=self.config)
if self.instant_listen or not listen:
play_audio(sound)
else:
Expand Down Expand Up @@ -947,7 +949,9 @@ def listen(self, source, stream):
return None, lang

LOG.debug("Thinking...")
play_end_listening_sound()
sound = self.config.get("sounds", {}).get("end_listening")
if sound:
play_audio(resolve_resource_file(sound))
return audio_data, lang

def _listen_phrase(self, source, sec_per_buffer, stream):
Expand Down
2 changes: 1 addition & 1 deletion ovos_listener/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from ovos_plugin_manager.stt import get_stt_lang_configs, get_stt_supported_langs, get_stt_module_configs
from ovos_plugin_manager.vad import get_vad_configs
from ovos_plugin_manager.wakewords import get_ww_lang_configs, get_ww_supported_langs, get_ww_module_configs
from ovos_utils.enclosure.api import EnclosureAPI
from ovos_bus_client.apis.enclosure import EnclosureAPI
from ovos_utils.log import LOG
from ovos_utils.process_utils import ProcessStatus, StatusCallbackMap

Expand Down
10 changes: 5 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ ovos-vad-plugin-webrtcvad

ovos-ww-plugin-pocketsphinx~=0.1, >=0.1.3
# NOTE - either tflite or tensorflow must be installed manually in addition to precise-lite
ovos-ww-plugin-precise-lite~=0.1, >=0.1.2a3
ovos-ww-plugin-precise-lite~=0.1, >=0.1.2
ovos-ww-plugin-vosk

ovos-stt-plugin-server~=0.0, >=0.0.2
ovos-stt-plugin-vosk~=0.1

ovos-utils~=0.0, >=0.0.31a3
ovos-utils~=0.0, >=0.0.31
ovos-bus-client>=0.0.3a16,~=0.0
ovos-plugin-manager~=0.0, >=0.0.23a5
ovos-config~=0.0,>=0.0.8a3
ovos_backend_client~=0.0, >=0.0.7a2
ovos-plugin-manager~=0.0, >=0.0.23
ovos-config~=0.0,>=0.0.8
ovos_backend_client~=0.0, >=0.0.7
2 changes: 1 addition & 1 deletion requirements/tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ pytest==5.2.4
pytest-cov==2.8.1
cov-core==1.15.0

ovos-stt-plugin-selene>=0.0.3a3
ovos-stt-plugin-selene>=0.0.3
ovos-stt-plugin-vosk>=0.1.3

0 comments on commit 26a5600

Please sign in to comment.