feat: allow using all voices available
This commit is contained in:
parent
f06dd4e049
commit
fd53cdb529
1 changed files with 5 additions and 7 deletions
12
tts.py
12
tts.py
|
@ -44,12 +44,10 @@ def parse_args():
|
|||
def main():
|
||||
args=parse_args()
|
||||
pipeline = KPipeline(lang_code='a', device=args.device, repo_id='hexgrad/Kokoro-82M')
|
||||
voice=voices[args.voice]
|
||||
if voice is None:
|
||||
if args.voice is None:
|
||||
voice=voices['pro']
|
||||
else:
|
||||
voice=args.voice
|
||||
if args.voice in voices:
|
||||
voice=voices[args.voice]
|
||||
else:
|
||||
voice=voices['pro'] if args.voice is None else args.voice
|
||||
|
||||
# filename argument
|
||||
file_path = args.input
|
||||
|
@ -59,7 +57,7 @@ def main():
|
|||
|
||||
file = open(file_path, "r")
|
||||
text = file.read()
|
||||
generator = pipeline(text, voice=voices[args.voice])
|
||||
generator = pipeline(text, voice=voice)
|
||||
|
||||
output_files = []
|
||||
length = 0
|
||||
|
|
Loading…
Reference in a new issue