From 6a267efbfe6341caf227647610fde75ef691c8d7 Mon Sep 17 00:00:00 2001 From: dwm66 Date: Fri, 20 Dec 2019 14:28:53 +0100 Subject: [PATCH 1/2] Add basic SSML support to AWS Polly --- lib/tts-providers/aws-polly.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/tts-providers/aws-polly.js b/lib/tts-providers/aws-polly.js index bd7aa35e..f2365cb6 100644 --- a/lib/tts-providers/aws-polly.js +++ b/lib/tts-providers/aws-polly.js @@ -23,6 +23,9 @@ function polly(phrase, voiceName) { // Construct a filesystem neutral filename const dynamicParameters = { Text: phrase }; const synthesizeParameters = Object.assign({}, DEFAULT_SETTINGS, dynamicParameters); + if (phrase.startsWith('') && phrase.endsWith('')) { + synthesizeParameters.textType = 'ssml'; + } if (settings.aws.name) { synthesizeParameters.VoiceId = settings.aws.name; } From 3815e0400daf5787edbcb8a2c6c1417ba83fcbe5 Mon Sep 17 00:00:00 2001 From: dwm66 Date: Fri, 20 Dec 2019 14:35:09 +0100 Subject: [PATCH 2/2] Typo fix in SSML support of Polly --- lib/tts-providers/aws-polly.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tts-providers/aws-polly.js b/lib/tts-providers/aws-polly.js index f2365cb6..8d324170 100644 --- a/lib/tts-providers/aws-polly.js +++ b/lib/tts-providers/aws-polly.js @@ -24,7 +24,7 @@ function polly(phrase, voiceName) { const dynamicParameters = { Text: phrase }; const synthesizeParameters = Object.assign({}, DEFAULT_SETTINGS, dynamicParameters); if (phrase.startsWith('') && phrase.endsWith('')) { - synthesizeParameters.textType = 'ssml'; + synthesizeParameters.TextType = 'ssml'; } if (settings.aws.name) { synthesizeParameters.VoiceId = settings.aws.name;