TTS 文本 vs SSML

给个例子:

MRCP/2.0 246 SPEAK 1
Channel-Identifier: b227c392d70b478e@speechsynth
Content-Type: text/plain
Voice-Name: xx
Content-Length: 11

How are you

其中 Content-Type 是文本

那么 FreeSWITCH 能不能让 Content-Type 变成 ssxml 呢?

官方文档说可以,就是这一句:

mod_unimrcp supports plain text and Speech Synthesis Markup Language (SSML). TTS can be sent using either speak or playback (if prefixed with say:unimrcp:[optional voice]:<TTS text>).

我没试过(目前没有环境),但估计要这样配置:


  <profile name="my-mrcp2" version="2">
    <!--param name="client-ext-ip" value="auto"-->
    <param name="client-ip" value="auto"/>
    <param name="client-port" value="5090"/>
    <param name="server-ip" value="10.5.5.152"/>
    <param name="server-port" value="5060"/>
    <!--param name="force-destination" value="1"/-->
    <param name="sip-transport" value="udp"/>
    <!--param name="ua-name" value="FreeSWITCH"/-->
    <!--param name="sdp-origin" value="FreeSWITCH"/-->
    <!--param name="rtp-ext-ip" value="auto"/-->
    <param name="rtp-ip" value="auto"/>
    <param name="rtp-port-min" value="4000"/>
    <param name="rtp-port-max" value="5000"/>
    <!-- enable/disable rtcp support -->
    <param name="rtcp" value="1"/>
    <!-- rtcp bye policies (rtcp must be enabled first)
             0 - disable rtcp bye
             1 - send rtcp bye at the end of session
             2 - send rtcp bye also at the end of each talkspurt (input)
    -->
    <param name="rtcp-bye" value="2"/>
    <!-- rtcp transmission interval in msec (set 0 to disable) -->
    <param name="rtcp-tx-interval" value="5000"/>
    <!-- period (timeout) to check for new rtcp messages in msec (set 0 to disable) -->
    <param name="rtcp-rx-resolution" value="1000"/>
    <!--param name="playout-delay" value="50"/-->
    <!--param name="max-playout-delay" value="200"/-->
    <!--param name="ptime" value="20"/-->
    <param name="codecs" value="PCMU PCMA L16/96/8000"/>


    <param name="ssml-mime-type" value="application/ssml+xml"/>


    <!-- Add any default MRCP params for SPEAK requests here -->
    <synthparams>
    </synthparams>

    <!-- Add any default MRCP params for RECOGNIZE requests here -->
    <recogparams>
      <!--param name="start-input-timers" value="false"/-->
    </recogparams>
  </profile>

其实就是多了个 ssml-mime-type 参数

有机会的可以试试下面这段 lua 代码:

session:set_tts_parms("unimrcp", "voice");
session:speak("<?xml >Hello, <emphasis level='strong'>John</emphasis> how are you?</>");
 

其中, Hello, John (重音),  how are you?

支持更多的变化

关于 ssml 的资料可以参考这里:

https://www.w3.org/TR/speech-synthesis/

华裔居多

关于 mrcpv2 asr 的协议细节可参考这里:

https://cloud.tencent.com/developer/article/2397548

文章写的极好

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值