怎么查看网站虚拟空间,辽宁建设工程信息网上开标流程,济南企业建设网站,建设网站西丽最近得知有人受mrcp的困扰#xff0c;于是写了这篇小文#xff0c;希望能有所帮助
FreeSWITCH版本选择
目前当然选择1.10.10#xff0c;不建议老版本#xff0c;差别在于老版本用到的libmrcp比较旧#xff0c;是1.2版本#xff0c;bug比较多#xff0c;有时会crash于是写了这篇小文希望能有所帮助
FreeSWITCH版本选择
目前当然选择1.10.10不建议老版本差别在于老版本用到的libmrcp比较旧是1.2版本bug比较多有时会crash而FreeSWITCH1.10.10用libmcrp1.6要稳定很多
编译
编译不在本文的讨论范围可能有点小麻烦但可以解决
配置
可以找到FreeSWITCH1.10.6版本的vanilla配置复制过来可以这样做以ali为例
modules.conf.xml里面增加 load modulemod_unimrcp/unimrcp.conf.xml里面 param namedefault-tts-profile valueali/ 和param namedefault-asr-profile valueali/mrcp_profiles目前下的文件只保留nuance-5.0-mrcp-v2.xml其它的文件可以删除nuance-5.0-mrcp-v2.xml改名为ali.xmlali.xml里面 name改为aliserver-ip和server-port指向sdm的sip地址和sip端口
测试路由
!--tts例子1--
action applicationanswer data
action applicationset dataplayback_delimiter!
action applicationset datatts_engineunimrcp !-- 或者unimrcp:ali --
action applicationset datatts_voicexiaoyan !-- 这个参数很重要要找阿里确认 --
action applicationplayback datasay:欢迎使用tts测试系统!welcome.wav !--同时tts和本地语音文件--!--tts例子2--
action applicationanswer data
action applicationspeak dataunimrcp|xiaoyan|欢迎使用tts测试系统 !--第二个参数是xiaoyan但需要找阿里确认--本文没有提供asr例子可以去别的地方去找
我觉得tts参数比较少比较容易调试。先搞定tts, asr就不难了
调试
调试的主要方法是看日志和抓包从sip invite开始看里面一般是二个media其中一个当然是rtp关注c地址另外一个就是mrcp关注地址和mrcp端口
常见问题
1.ali和tengxun如何并存
同时放二个文件ali.xml和tengxun.xml当然profile 名称不能一样client-port不能一样
在应用层tts_engine设置为unimrcp:ali或者设置为unimrcp:tengxun这样就可以区别开了
2.听不到tts抓包发现tts server没有发rtp流过来但sip流程正常
看fs的c地址是不是127.0.0.1如果是那么client-ip和rtp-ip不能配成auto让fs自动找要修改成$${local_ip_v4}或者写死比如192.168.1.100本机ipv4。此外如果有nat那么client-ext-ip和rtp-ext-ip可能需要设置下。抓包能定位到这些问题有兴趣的可以研究下mod_unimrcp.c
3.1001 bridge 1002需要同时识别要怎么做
重点是2条腿都需要execute detect_speech先启动不能execute play_and_detect_speech后者不能返回
在收到pause之后execute detect_speech resume 继续识别
下面给出启动时的lua代码
function debug(s)session:consoleLog(DEBUG, (s or (NULL)) .. \n)
end
debug(start-asr entry)-- session:execute(info)
debug(caller .. session:getVariable(caller_id_number) .. callee .. session:getVariable(destination_number))
session:setVariable(fire_asr_events, true)
-- 开始识别
session:execute(detect_speech, unimrcp {start-input-timerstrue,Speech-Complete-Timeout10000,no-input-timeout3000,recognition-timeout60000}builtin:grammar/boolean?languagezh-CN;y1;n2 builtin)
-- session:execute(detect_speech, param start-input-timers true)
-- session:execute(detect_speech, param Recognition-Mode continuous)
debug(start-asr exit)uuid_broadcast可以执行application对esl程序可能有用本人不会esl好惭愧
其它
sdm支持连续的语音识别但mrcp不支持或许以后可以修改源码来支持这个特性
dtmf mrcp支持但sdm不支持lua可以设置回调可能可以解决识别的过程中收码的问题
function my_cb(s, type, obj, arg)
-- ...
endblah w00t
session:setInputCallback(my_cb, blah)
session:execute(play_and_detect_speech,...
-- ...本文完全是凭记忆写成的或许以后可以适当补充日志。