From aae77dac0748b095c701b291d8c830701c023ed5 Mon Sep 17 00:00:00 2001 From: Jindrich Matousek Date: Wed, 6 Apr 2022 10:06:06 +0200 Subject: [PATCH] WA: when [!] is not at the end of a sentence, it is used as a glottal stop in the phonetic input and sentences are NOT delimited by [!] --- TTS/utils/synthesizer.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/TTS/utils/synthesizer.py b/TTS/utils/synthesizer.py index d1abc907..392531a6 100644 --- a/TTS/utils/synthesizer.py +++ b/TTS/utils/synthesizer.py @@ -155,7 +155,13 @@ class Synthesizer(object): Returns: List[str]: list of sentences. """ - return self.seg.segment(text) + # JMa + # WA: fix glottal stop (!): "ahoj, !", "ahoj." => "ahoj, !ahoj." + # Exclamation mark (!) at the end of the sentence should not be affected. + # return self.seg.segment(text) + sents = self.seg.segment(text) + split_text = " ".join(sents) + return [split_text.replace("! ", "!")] def save_wav(self, wav: List[int], path: str) -> None: """Save the waveform as a file.