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)