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

update plugin config #5

Closed
wants to merge 2 commits into from
Closed
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
24 changes: 3 additions & 21 deletions ovos_tts_plugin_mimic3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
import re
import typing
import wave
from os.path import join
from pathlib import Path
from threading import Lock

from mimic3_tts import AudioResult, Mimic3Settings, Mimic3TextToSpeechSystem, SSMLSpeaker
from os.path import join
from ovos_plugin_manager.tts import TTS
from ovos_utils.xdg_utils import xdg_data_home
from pathlib import Path
from threading import Lock
from ovos_utils.log import LOG


Expand Down Expand Up @@ -36,23 +35,6 @@ class Mimic3TTSPlugin(TTS):

def __init__(self, lang="en-us", config=None):
ssml_tags = ["speak", "s", "w", "voice", "prosody", "say-as", "break", "sub", "phoneme"]
config = config or {}
voice = config.get("voice")
speaker = config.get("speaker")
if not voice:
if lang not in self.default_voices:
lang = lang.split("-")[0]
if lang in self.default_voices:
voice = self.default_voices[lang]
config["voice"] = voice
else:
LOG.warning("Default mimic3 voice not set!")

if voice and not speaker:
if "#" in voice:
voice, speaker = voice.split("#")
config["voice"] = voice
config["speaker"] = speaker
super().__init__(lang, config, ssml_tags=ssml_tags)
self.speaker = self.config.get("speaker")
self.lock = Lock()
Expand Down
Loading