From 242e6e0a05147164bf2398b22f44ac99961b8aac Mon Sep 17 00:00:00 2001 From: Ayo Date: Fri, 5 Sep 2025 21:19:26 +0200 Subject: [PATCH] feat: use correct lang_code --- tts.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tts.py b/tts.py index c94a0c6..557d9d5 100644 --- a/tts.py +++ b/tts.py @@ -131,14 +131,13 @@ def main(): # Generate audio with yaspin() as spinner: spinner.text = spinner_text - + args=parse_args() if not args.verbose: # Disable all warnings warnings.filterwarnings("ignore") - - pipeline = KPipeline(lang_code='a', device=args.device, repo_id='hexgrad/Kokoro-82M') + if args.voice in voices: voice=voices[args.voice] else: @@ -168,6 +167,9 @@ def main(): name = name.replace("\\", "_") name = name.replace("/", "_") + lang_code = voice[0] + pipeline = KPipeline(lang_code=lang_code, device=args.device, repo_id='hexgrad/Kokoro-82M') + ''' Split patterns: - only multiple consecutive new line (to handle wrapped statements)