From bb2ab222706ee5d8ff532598994f0fc4965a25a8 Mon Sep 17 00:00:00 2001 From: met4citizen Date: Mon, 8 Jul 2024 15:10:03 +0300 Subject: [PATCH] Workaround for Google TTS not pausing for dashes --- modules/talkinghead.mjs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/talkinghead.mjs b/modules/talkinghead.mjs index 58f95f9..47c74d5 100755 --- a/modules/talkinghead.mjs +++ b/modules/talkinghead.mjs @@ -2026,7 +2026,7 @@ class TalkingHead { // Classifiers const dividersSentence = /[!\.\?\n\p{Extended_Pictographic}]/ug; const dividersWord = /[ ]/ug; - const speakables = /[\p{L}\p{N},\.'!€\$\+\-–—%&\?]/ug; + const speakables = /[\p{L}\p{N},\.'!€\$\+\p{Dash_Punctuation}%&\?]/ug; const emojis = /[\p{Extended_Pictographic}]/ug; const lipsyncLang = opt.lipsyncLang || this.avatar.lipsyncLang || this.opt.lipsyncLang; @@ -2474,7 +2474,8 @@ class TalkingHead { .replaceAll('<','<') .replaceAll('>','>') .replaceAll('"','"') - .replaceAll('\'','''); + .replaceAll('\'',''') + .replace(/^\p{Dash_Punctuation}$/ug,''); }); ssml += "";