diff --git a/TTS/bin/extract_tts_spectrograms.py b/TTS/bin/extract_tts_spectrograms.py index ace7464a..fb3a8321 100755 --- a/TTS/bin/extract_tts_spectrograms.py +++ b/TTS/bin/extract_tts_spectrograms.py @@ -299,4 +299,5 @@ if __name__ == "__main__": args = parser.parse_args() c = load_config(args.config_path) + c.audio["do_trim_silence"] = False # IMPORTANT!!!!!!!!!!!!!!! disable to align mel main(args) diff --git a/TTS/tts/utils/synthesis.py b/TTS/tts/utils/synthesis.py index da50f1ca..0ddf7ebe 100644 --- a/TTS/tts/utils/synthesis.py +++ b/TTS/tts/utils/synthesis.py @@ -25,7 +25,7 @@ def text_to_seqvec(text, CONFIG): CONFIG.enable_eos_bos_chars, tp=CONFIG.characters, add_blank=CONFIG.add_blank, - use_espeak_phonemes=CONFIG.use_espeak_phonemes + use_espeak_phonemes=CONFIG.use_espeak_phonemes, ), dtype=np.int32, ) diff --git a/TTS/tts/utils/text/__init__.py b/TTS/tts/utils/text/__init__.py index 350e5934..787394b5 100644 --- a/TTS/tts/utils/text/__init__.py +++ b/TTS/tts/utils/text/__init__.py @@ -54,7 +54,7 @@ def text2phone(text, language, use_espeak_phonemes=False): if gruut.is_language_supported(language): # Use gruut for phonemization - phonemizer_args={ + phonemizer_args = { "remove_stress": True, "ipa_minor_breaks": False, # don't replace commas/semi-colons with IPA | "ipa_major_breaks": False, # don't replace periods with IPA ‖ @@ -104,7 +104,9 @@ def pad_with_eos_bos(phoneme_sequence, tp=None): return [_phonemes_to_id[_bos]] + list(phoneme_sequence) + [_phonemes_to_id[_eos]] -def phoneme_to_sequence(text, cleaner_names, language, enable_eos_bos=False, tp=None, add_blank=False, use_espeak_phonemes=False): +def phoneme_to_sequence( + text, cleaner_names, language, enable_eos_bos=False, tp=None, add_blank=False, use_espeak_phonemes=False +): # pylint: disable=global-statement global _phonemes_to_id, _phonemes if tp: diff --git a/tests/test_text_processing.py b/tests/test_text_processing.py index 17ee755e..4a1ba64f 100644 --- a/tests/test_text_processing.py +++ b/tests/test_text_processing.py @@ -26,6 +26,7 @@ class TextProcessingTextCase(unittest.TestCase): self._test_phoneme_to_sequence(add_blank=True) def _test_phoneme_to_sequence(self, add_blank): + """Verify en-us sentence phonemes""" text_cleaner = ["phoneme_cleaners"] sequence = phoneme_to_sequence(EXAMPLE_TEXT, text_cleaner, LANG, add_blank=add_blank, use_espeak_phonemes=True) text_hat = sequence_to_phoneme(sequence) @@ -92,7 +93,7 @@ class TextProcessingTextCase(unittest.TestCase): self.assertEqual(text_hat, gt) def test_text2phone(self): - text = "Recent research at Harvard has shown meditating for as little as 8 weeks can actually increase, the grey matter in the parts of the brain responsible for emotional regulation and learning!" + """Verify phones directly (with |)""" ph = text2phone(EXAMPLE_TEXT, LANG) self.assertEqual(ph, EXPECTED_PHONEMES)