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