fixed out of range exception
parent
80c0ce403e
commit
2d9b12af95
|
|
@ -95,8 +95,7 @@ class SynthVariant(object):
|
|||
self.name = voice
|
||||
self.lang = lang
|
||||
self.phoneme_capable = self.is_phoneme_capable()
|
||||
if self.phoneme_capable:
|
||||
create_dir(dest_dir + self.name + '/' + str(self.rate))
|
||||
|
||||
|
||||
def __repr__(self):
|
||||
return 'Synthesizer[{} - {}]'.format(self.name, self.rate)
|
||||
|
|
@ -128,6 +127,10 @@ class SynthVariant(object):
|
|||
cli_gen_audio(phon_cmd, self.rate, self.name, d_path)
|
||||
return SynthFile(word, phoneme, r_path, self.name, self.lang, self.rate, variant)
|
||||
|
||||
def create_synth_dirs(self):
|
||||
if self.phoneme_capable:
|
||||
create_dir(dest_dir + self.name + '/' + str(self.rate))
|
||||
|
||||
@staticmethod
|
||||
def voices_for_lang(lang):
|
||||
voices_installed = NSSpeechSynthesizer.availableVoices()
|
||||
|
|
@ -168,9 +171,10 @@ def synth_generator():
|
|||
|
||||
def synth_for_words(words, writer):
|
||||
prog_title = "Synthesizing {} words : ".format(len(words))
|
||||
(update, prog) = prog_bar(prog_title)
|
||||
for s in voice_synths:
|
||||
s.create_synth_dirs()
|
||||
for v in ['low', 'medium', 'high']:
|
||||
(update, prog) = prog_bar(prog_title)
|
||||
for w in prog(words):
|
||||
update('"{}" with {} variant ({})'.format(w, s, v))
|
||||
synthed = s.generate_audio(w, v)
|
||||
|
|
|
|||
Loading…
Reference in New Issue