|
|
|
@ -10,6 +10,7 @@ import traceback
|
|
|
|
|
import sys
|
|
|
|
|
import torch
|
|
|
|
|
import librosa
|
|
|
|
|
import re
|
|
|
|
|
from audioread.exceptions import NoBackendError
|
|
|
|
|
|
|
|
|
|
# Use this directory structure for your datasets, or modify it to fit your needs
|
|
|
|
@ -224,6 +225,13 @@ class Toolbox:
|
|
|
|
|
self.init_synthesizer()
|
|
|
|
|
|
|
|
|
|
texts = self.ui.text_prompt.toPlainText().split("\n")
|
|
|
|
|
punctuation = '!,。、,' # punctuate and split/clean text
|
|
|
|
|
processed_texts = []
|
|
|
|
|
for text in texts:
|
|
|
|
|
for processed_text in re.sub(r'[{}]+'.format(punctuation), '\n', text).split('\n'):
|
|
|
|
|
if processed_text:
|
|
|
|
|
processed_texts.append(processed_text.strip())
|
|
|
|
|
texts = processed_texts
|
|
|
|
|
embed = self.ui.selected_utterance.embed
|
|
|
|
|
embeds = [embed] * len(texts)
|
|
|
|
|
specs = self.synthesizer.synthesize_spectrograms(texts, embeds)
|
|
|
|
|