change edge tts _SSMLTemplate
This commit is contained in:
parent
da0210a6a1
commit
a459703424
|
@ -233,17 +233,9 @@ export class MsEdgeTTS {
|
||||||
}
|
}
|
||||||
|
|
||||||
private _SSMLTemplate(input: string, options: ProsodyOptions = {}): string {
|
private _SSMLTemplate(input: string, options: ProsodyOptions = {}): string {
|
||||||
// 对 input 进行特殊字符替换
|
// in case future updates to the edge API block these elements, we'll be concatenating strings.
|
||||||
input = input
|
|
||||||
.replace(/&/g, "&")
|
|
||||||
.replace(/</g, "<")
|
|
||||||
.replace(/>/g, ">");
|
|
||||||
|
|
||||||
// 合并默认选项与传入选项
|
|
||||||
options = { ...new ProsodyOptions(), ...options };
|
options = { ...new ProsodyOptions(), ...options };
|
||||||
|
return `<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xmlns:mstts="https://www.w3.org/2001/mstts" xml:lang="${this._voiceLocale}">
|
||||||
return `
|
|
||||||
<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xmlns:mstts="https://www.w3.org/2001/mstts" xml:lang="${this._voiceLocale}">
|
|
||||||
<voice name="${this._voice}">
|
<voice name="${this._voice}">
|
||||||
<prosody pitch="${options.pitch}" rate="${options.rate}" volume="${options.volume}">
|
<prosody pitch="${options.pitch}" rate="${options.rate}" volume="${options.volume}">
|
||||||
${input}
|
${input}
|
||||||
|
|
Loading…
Reference in New Issue