输入框自动识别三种写法,无需切换开关:
[标记] 时,按标记控制局部效果(顶部滑块被忽略)。<speak 或 <?xml 开头时,整段原样作为 SSML 发送。| 标记 | 作用 | 示例 |
|---|---|---|
[pause:500ms] | 停顿(亦可用 [br],固定 500ms) | 你好[pause:500ms]世界 |
[emphasis:strong]…[/emphasis] | 重读(level:strong/moderate/reduced) | [emphasis:strong]重要[/emphasis] |
[rate:slow]…[/rate] | 语速(x-slow/slow/medium/fast/x-fast 或 0.5~2.0) | [rate:slow]慢点说[/rate] |
[pitch:+10%]…[/pitch] | 音调(x-low~x-high 或 +/-百分比) | [pitch:+10%]高一点[/pitch] |
[volume:loud]…[/volume] | 音量(silent/x-soft/soft/medium/loud/x-loud 或 0~100) | [volume:loud]大声[/volume] |
[say-as:telephone]…[/say-as] | 数字读法(见下表) | [say-as:telephone]13800138000[/say-as] |
[sub:世界]…[/sub] | 别名替换(读「世界」,原字「世」) | [sub:世界]世[/sub]界 |
[phoneme:ju]…[/phoneme] | 拼音/音标读音(IPA 或 X-SAMPA) | [phoneme:yú]鱼[/phoneme] |
[style:cheerful]…[/style] | 情感风格 | [style:cheerful]开心[/style] |
[voice:语音名]…[/voice] | 中途切换声音(如 zh-CN-YunxiNeural) | [voice:zh-CN-YunxiNeural]男声[/voice] |
风格程度可写 [style:cheerful:2](第二个值即 styledegree,1.0~2.0)。
say-as 取值telephone 电话 · cardinal 数字 · ordinal 序数 · digits 逐位 · characters 拼读 · date 日期 · time 时间 · currency 金额 · address 地址。
< > & 等特殊字符安全;未知标记、未闭合标记会原样保留 / 自动补全。[voice] 会切成独立的语音请求分别合成(同一段内可多次换声)。<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xmlns:mstts="http://www.w3.org/2001/mstts" xml:lang="zh-CN"> <voice name="zh-CN-XiaoxiaoNeural"> <mstts:express-as style="cheerful" styledegree="2"> 大家好!<break time="500ms"/>这是 <emphasis level="strong">示例</emphasis>。 </mstts:express-as> <break time="300ms"/> <prosody rate="slow" pitch="+10%">慢速、稍高音调。</prosody> 电话:<say-as interpret-as="telephone">13800138000</say-as>。 </voice> </speak>