mirror of
https://github.com/denizsafak/abogen.git
synced 2026-07-18 13:40:27 +02:00
voice can either be a formula or just the old approach
This commit is contained in:
@@ -348,7 +348,11 @@ class ConversionThread(QThread):
|
||||
# Set split_pattern to \n+ which will split on one or more newlines
|
||||
split_pattern = r"\n+"
|
||||
|
||||
# Check if the voice is a formula and load it if necessary
|
||||
if '*' in self.voice:
|
||||
loaded_voice = get_new_voice(tts, self.voice, self.use_gpu)
|
||||
else:
|
||||
loaded_voice = self.voice
|
||||
|
||||
for result in tts(
|
||||
chapter_text,
|
||||
|
||||
+6
-2
@@ -1049,13 +1049,17 @@ class abogen(QWidget):
|
||||
else self.subtitle_mode
|
||||
)
|
||||
|
||||
voice_formula = self.voice_formula.toPlainText()
|
||||
# if voice formula is not None, use the selected voice
|
||||
if self.mixed_voice_state:
|
||||
formula_components = [f"{weight} * {name}" for name, weight in self.mixed_voice_state]
|
||||
voice_formula = " + ".join(filter(None, formula_components))
|
||||
else:
|
||||
voice_formula = self.selected_voice
|
||||
|
||||
self.conversion_thread = ConversionThread(
|
||||
self.selected_file,
|
||||
self.selected_lang,
|
||||
speed,
|
||||
#self.selected_voice,
|
||||
voice_formula,
|
||||
self.save_option,
|
||||
self.selected_output_folder,
|
||||
|
||||
Reference in New Issue
Block a user