From f379f08c6644c87faf329bdb942a5806c6494036 Mon Sep 17 00:00:00 2001 From: miro Date: Sun, 15 Dec 2024 21:55:37 +0000 Subject: [PATCH] test --- ovos_tts_plugin_piper/__init__.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ovos_tts_plugin_piper/__init__.py b/ovos_tts_plugin_piper/__init__.py index 403226f..1bcf683 100644 --- a/ovos_tts_plugin_piper/__init__.py +++ b/ovos_tts_plugin_piper/__init__.py @@ -52,7 +52,7 @@ def __init__(self, config=None): self.noise_w = self.config.get("noise-w") # Phoneme width noise # pre-load models - preload_voices = self.config.get("preload_voices") or [] + preload_voices = self.config.get("preload_voices") or [self.voice] preload_langs = self.config.get("preload_langs") or [] for lang in preload_langs: @@ -177,4 +177,13 @@ def available_languages(self) -> set: } e = PiperTTSPlugin(config=config) e.get_tts("hello world", "hello.wav") - print(PiperTTSPluginConfig) + + # test all voices + for lang, voices in PiperTTSPluginConfig.items(): + for voice in voices: + v = list(voice.keys())[0] + print(lang, v) + e = PiperTTSPlugin(config={"voice": v, "lang": lang}) + e.get_tts("test 1 2 3", f"{lang}_{v}.wav", + voice=v, lang=lang) +