From 6977899d072a4705bd44e81c1632ff4698524bb1 Mon Sep 17 00:00:00 2001 From: erogol Date: Wed, 19 Feb 2020 17:54:06 +0100 Subject: [PATCH] fix constant GL bug in synthesis --- utils/synthesis.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/utils/synthesis.py b/utils/synthesis.py index f066228a..79a17c78 100644 --- a/utils/synthesis.py +++ b/utils/synthesis.py @@ -78,6 +78,7 @@ def synthesis(model, style_wav=None, truncated=False, enable_eos_bos_chars=False, #pylint: disable=unused-argument + use_griffin_lim=False, do_trim_silence=False): """Synthesize voice for the given text. @@ -111,8 +112,10 @@ def synthesis(model, postnet_output, decoder_output, alignment = parse_outputs( postnet_output, decoder_output, alignments) # plot results - wav = inv_spectrogram(postnet_output, ap, CONFIG) - # trim silence - if do_trim_silence: - wav = trim_silence(wav, ap) + wav = None + if use_griffin_lim: + wav = inv_spectrogram(postnet_output, ap, CONFIG) + # trim silence + if do_trim_silence: + wav = trim_silence(wav, ap) return wav, alignment, decoder_output, postnet_output, stop_tokens