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

migrate to OpenVoiceOS/OVOS-plugin-manager #19

Merged
merged 1 commit into from
Sep 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions mycroft_voice_satellite/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@
from ovos_utils.log import LOG
from ovos_utils import create_daemon
from ovos_utils.messagebus import Message
from text2speech import TTSFactory
from tempfile import gettempdir
from os.path import join, isdir
from os import makedirs
from mycroft_voice_satellite.playback import play_audio, play_mp3, play_ogg, \
play_wav, resolve_resource_file

from ovos_plugin_manager.tts import OVOSTTSFactory


class JarbasVoiceTerminalProtocol(HiveMindTerminalProtocol):
Expand All @@ -38,9 +37,8 @@ def __init__(self, config=CONFIGURATION, *args, **kwargs):
super().__init__(*args, **kwargs)
self.config = config
self.loop = RecognizerLoop(self.config)
self.tts = TTSFactory.create(self.config["tts"])
self.tts = OVOSTTSFactory.create(self.config["tts"])
LOG.debug("Using TTS engine: " + self.tts.__class__.__name__)
self.tts.validate()

# Voice Output
def speak(self, utterance):
Expand Down
27 changes: 15 additions & 12 deletions mycroft_voice_satellite/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,23 @@

def discover_hivemind(name="JarbasVoiceTerminal",
access_key="RESISTENCEisFUTILE",
crypto_key="resistanceISfutile"):
crypto_key=None):
discovery = LocalDiscovery()
headers = HiveMindConnection.get_headers(name, access_key)

while True:
LOG.info("Scanning...")
for node_url in discovery.scan():
LOG.info("Fetching Node data: {url}".format(url=node_url))
node = discovery.nodes[node_url]
node.connect(crypto_key=crypto_key,
node_type=JarbasVoiceTerminal,
headers=headers
)
sleep(5)
try:
LOG.info("Scanning...")
for node_url in discovery.scan():
LOG.info("Fetching Node data: {url}".format(url=node_url))
node = discovery.nodes[node_url]
node.connect(crypto_key=crypto_key,
node_type=JarbasVoiceTerminal,
headers=headers
)
sleep(5)
except KeyboardInterrupt:
break


def main():
Expand All @@ -30,7 +33,7 @@ def main():
parser.add_argument("--access_key", help="access key",
default="RESISTENCEisFUTILE")
parser.add_argument("--crypto_key", help="payload encryption key",
default="resistanceISfutile")
default=None)
parser.add_argument("--name", help="human readable device name",
default="JarbasVoiceTerminal")
parser.add_argument("--host", help="HiveMind host")
Expand All @@ -40,7 +43,7 @@ def main():

if args.host:
# Direct Connection
connect_to_hivemind(host=args.host, port=args.port,
connect_to_hivemind(host=args.host, port=int(args.port),
name=args.name, access_key=args.access_key,
crypto_key=args.crypto_key)

Expand Down
13 changes: 1 addition & 12 deletions mycroft_voice_satellite/configuration/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,7 @@
},

'log_blacklist': [],
'stt': {'deepspeech_server': {'uri': 'http://localhost:8080/stt'},
'deepspeech_stream_server': {
'stream_uri': 'http://localhost:8080/stt?format=16K_PCM16'},
'kaldi': {
'uri': 'http://localhost:8080/client/dynamic/recognize'},
'kaldi_vosk': {'model': '/path/to/model/folder'},
'kaldi_vosk_streaming': {'model': '/path/to/model/folder'},
"deepspeech": {"model": "path/to/model.pbmm",
"scorer": "path/to/model.scorer"},
"deepspeech_streaming": {"model": "path/to/model.pbmm",
"scorer": "path/to/model.scorer"},
'module': 'google'},
'stt': {'module': 'google'},
'tts': {'module': 'responsive_voice'}}


Expand Down
2 changes: 0 additions & 2 deletions mycroft_voice_satellite/speech/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Copyright 2017 Mycroft AI Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down
Loading