forked from mrq/tortoise-tts
read.py: allow user-specified splits
This commit is contained in:
parent
945bd88f21
commit
0005d02940
0
tortoise/data/layman.txt
Normal file
0
tortoise/data/layman.txt
Normal file
|
@ -48,14 +48,20 @@ if __name__ == '__main__':
|
|||
if regenerate is not None:
|
||||
regenerate = [int(e) for e in regenerate.split(',')]
|
||||
|
||||
# Process text
|
||||
with open(args.textfile, 'r', encoding='utf-8') as f:
|
||||
text = ' '.join([l for l in f.readlines()])
|
||||
if '|' in text:
|
||||
print("Found the '|' character in your text, which I will use as a cue for where to split it up. If this was not"
|
||||
"your intent, please remove all '|' characters from the input.")
|
||||
texts = text.split('|')
|
||||
else:
|
||||
texts = split_and_recombine_text(text)
|
||||
|
||||
for selected_voice in selected_voices:
|
||||
voice_outpath = os.path.join(outpath, selected_voice)
|
||||
os.makedirs(voice_outpath, exist_ok=True)
|
||||
|
||||
with open(args.textfile, 'r', encoding='utf-8') as f:
|
||||
text = ''.join([l for l in f.readlines()])
|
||||
texts = split_and_recombine_text(text)
|
||||
|
||||
if '&' in selected_voice:
|
||||
voice_sel = selected_voice.split('&')
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue
Block a user