@creativeorange/azure-text-to-speech 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/co-azure-tts.es.js +8 -1
- package/dist/co-azure-tts.umd.js +3 -1
- package/package.json +1 -1
- package/src/TextToSpeech.ts +10 -1
package/dist/co-azure-tts.es.js
CHANGED
@@ -8737,8 +8737,15 @@ class TextToSpeech {
|
|
8737
8737
|
if (this.url !== "") {
|
8738
8738
|
ssml += `<lexicon uri="${this.url}"/>`;
|
8739
8739
|
}
|
8740
|
-
ssml += `<prosody rate="${this.rate}%" pitch="${this.pitch}%"
|
8740
|
+
ssml += `<prosody rate="${this.rate}%" pitch="${this.pitch}%">
|
8741
|
+
${this.convertHtmlEntities(text)}
|
8742
|
+
</prosody></voice></speak>`;
|
8741
8743
|
return ssml;
|
8742
8744
|
}
|
8745
|
+
convertHtmlEntities(input) {
|
8746
|
+
const p = document.createElement(`p`);
|
8747
|
+
p.textContent = input;
|
8748
|
+
return p.innerHTML;
|
8749
|
+
}
|
8743
8750
|
}
|
8744
8751
|
export { SpeechToText, TextToSpeech };
|
package/dist/co-azure-tts.umd.js
CHANGED
@@ -24,4 +24,6 @@ File System access not available, please use Push or PullAudioOutputStream`),thi
|
|
24
24
|
xmlns:emo="http://www.w3.org/2009/10/emotionml"
|
25
25
|
version="1.0"
|
26
26
|
xml:lang="en-US">
|
27
|
-
<voice name="${this.voice}">`;return this.url!==""&&(t+=`<lexicon uri="${this.url}"/>`),t+=`<prosody rate="${this.rate}%" pitch="${this.pitch}%"
|
27
|
+
<voice name="${this.voice}">`;return this.url!==""&&(t+=`<lexicon uri="${this.url}"/>`),t+=`<prosody rate="${this.rate}%" pitch="${this.pitch}%">
|
28
|
+
${this.convertHtmlEntities(e)}
|
29
|
+
</prosody></voice></speak>`,t}convertHtmlEntities(e){const t=document.createElement("p");return t.textContent=e,t.innerHTML}}_.SpeechToText=Nr,_.TextToSpeech=xr,Object.defineProperties(_,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED
package/src/TextToSpeech.ts
CHANGED
@@ -370,7 +370,16 @@ export class TextToSpeech {
|
|
370
370
|
ssml += `<lexicon uri="${this.url}"/>`;
|
371
371
|
}
|
372
372
|
|
373
|
-
ssml += `<prosody rate="${this.rate}%" pitch="${this.pitch}%"
|
373
|
+
ssml += `<prosody rate="${this.rate}%" pitch="${this.pitch}%">
|
374
|
+
${this.convertHtmlEntities(text)}
|
375
|
+
</prosody></voice></speak>`;
|
374
376
|
return ssml;
|
375
377
|
}
|
378
|
+
|
379
|
+
convertHtmlEntities(input: string) {
|
380
|
+
const p = document.createElement(`p`);
|
381
|
+
p.textContent = input;
|
382
|
+
|
383
|
+
return p.innerHTML;
|
384
|
+
}
|
376
385
|
}
|