Skip to content

Commit

Permalink
feat:phal
Browse files Browse the repository at this point in the history
add support for PHAL plugins to integrate with platform
  • Loading branch information
JarbasAl committed Oct 26, 2024
1 parent 85cbf37 commit 2e721aa
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ Voice relay is built on top of [ovos-plugin-manager](https://github.com/OpenVoic

Supported plugins:

| Plugin Type | Description | Required | Link |
|-------------|-------------|----------|------|
| Microphone | Captures voice input | Yes | [Microphone](https://openvoiceos.github.io/ovos-technical-manual/mic_plugins/) |
| VAD | Voice Activity Detection | Yes | [VAD](https://openvoiceos.github.io/ovos-technical-manual/vad_plugins/) |
| Plugin Type | Description | Required | Link |
|-------------|-------------------------------------|----------|--------------------------------------------------------------------------------|
| Microphone | Captures voice input | Yes | [Microphone](https://openvoiceos.github.io/ovos-technical-manual/mic_plugins/) |
| VAD | Voice Activity Detection | Yes | [VAD](https://openvoiceos.github.io/ovos-technical-manual/vad_plugins/) |
| PHAL | Platform/Hardware Abstraction Layer | No | [PHAL](https://openvoiceos.github.io/ovos-technical-manual/PHAL/) |

> NOTE: the mic satellite can not (yet) play media, if you ask OVOS to "play XXX" nothing will happen as the mic-satellite will ignore the received uri
Expand Down
12 changes: 12 additions & 0 deletions hivemind_mic_sat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ def __init__(self):
self.hm_bus.on_mycroft("speak", self.handle_speak)
self.hm_bus.on_mycroft("speak:b64_audio.response", self.handle_speak_b64)
self.hm_bus.on_mycroft("ovos.utterance.handled", self.handle_complete)
try:
from ovos_PHAL.service import PHAL
self.phal = PHAL(bus=self.hm_bus)
self.phal.start()
except ImportError:
LOG.warning("PHAL is not available")
self.phal = None

def handle_stt_error(self, message: Message):
LOG.error("STT ERROR - transcription failed!")
Expand Down Expand Up @@ -119,6 +126,11 @@ def run(self):

self.running = False

def stop(self):
self.running = False
if self.phal:
self.phal.shutdown()


def run():
h = HiveMindMicrophoneClient()
Expand Down

0 comments on commit 2e721aa

Please sign in to comment.