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