@jambonz/speech-utils 0.2.11 → 0.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/synth-audio.js +4 -4
- package/package.json +1 -1
package/lib/synth-audio.js
CHANGED
|
@@ -479,10 +479,10 @@ async function _synthOnPremMicrosoft(logger, {
|
|
|
479
479
|
/* microsoft enforces some properties and uses voice xml element so if the user did not supply do it for them */
|
|
480
480
|
const words = content.slice(7, -8).trim().replace(/(\r\n|\n|\r)/gm, ' ');
|
|
481
481
|
// eslint-disable-next-line max-len
|
|
482
|
-
content = `<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xmlns:mstts="https://www.w3.org/2001/mstts" xml:lang="${language}"><
|
|
482
|
+
content = `<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xmlns:mstts="https://www.w3.org/2001/mstts" xml:lang="${language}"><voice name="${voice}">${words}</voice></speak>`;
|
|
483
483
|
logger.info({content}, 'synthMicrosoft');
|
|
484
484
|
}
|
|
485
|
-
else if (JAMBONES_AZURE_ENABLE_SSML) {
|
|
485
|
+
else if (JAMBONES_AZURE_ENABLE_SSML && !content.startsWith('<speak')) {
|
|
486
486
|
// eslint-disable-next-line max-len
|
|
487
487
|
content = `<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xmlns:mstts="https://www.w3.org/2001/mstts" xml:lang="${language}"><voice name="${voice}"><lang xml:lang="${language}">${text}</lang></voice></speak>`;
|
|
488
488
|
}
|
|
@@ -532,10 +532,10 @@ const synthMicrosoft = async(logger, {
|
|
|
532
532
|
/* microsoft enforces some properties and uses voice xml element so if the user did not supply do it for them */
|
|
533
533
|
const words = content.slice(7, -8).trim().replace(/(\r\n|\n|\r)/gm, ' ');
|
|
534
534
|
// eslint-disable-next-line max-len
|
|
535
|
-
content = `<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xmlns:mstts="https://www.w3.org/2001/mstts" xml:lang="${language}"><
|
|
535
|
+
content = `<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xmlns:mstts="https://www.w3.org/2001/mstts" xml:lang="${language}"><voice name="${voice}">${words}</voice></speak>`;
|
|
536
536
|
logger.info({content}, 'synthMicrosoft');
|
|
537
537
|
}
|
|
538
|
-
else if (JAMBONES_AZURE_ENABLE_SSML) {
|
|
538
|
+
else if (JAMBONES_AZURE_ENABLE_SSML && !content.startsWith('<speak')) {
|
|
539
539
|
// eslint-disable-next-line max-len
|
|
540
540
|
content = `<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xmlns:mstts="https://www.w3.org/2001/mstts" xml:lang="${language}"><voice name="${voice}"><lang xml:lang="${language}">${text}</lang></voice></speak>`;
|
|
541
541
|
}
|