UniMRCP 1.7.0初体验

  |   0 评论   |   0 浏览

背景

MRCP(Media Resource Control Protocol)是一个CS架构的网络协议,支持C端控制S端的媒体资源。

MRCP v1版本已经正式发布,MRCP v2目前是一个草案。

UniMRCP是一个开源跨平台的MRCP客户端和服务端的C/C++实现,通过Apache 2.0许可证分发。其中包括SIP、RTSP、SDP、MRCPv2、RTP/RTCP相关栈,以及对应的API。

初体验

目前UniMRCP v1最新版本为1.8.0,但线上环境使用的是 1.7.0。本文先继续使用1.7.0来做测试。

下载

进入页面,自行下载依赖包。

依赖包:unimrcp-deps-1.6.0.tar.gz (5.1M)

进入页面,自行下载。

资源包:unimrcp-1.7.0.tar.gz (3.3M)

编译依赖包

cd unimrcp-deps-1.6.0
./build-dep-libs.sh

编译MRCP包

sudo apt-get install autoconf automake libtool gcc pkg-config 
./configure --prefix=/opt/unimrcp
make
make install

运行

运行server

cd /opt/unimrcp/bin
LD_LIBRARY_PATH=/usr/local/lib/ ./unimrcpserver

结果

2024-04-08 17:04:31:169245 [INFO]   Start Task [MRCPv2-Agent-1]
2024-04-08 17:04:31:169374 [INFO]   Start Task [Media-Engine-1]
sres: /etc/resolv.conf: unknown option
2024-04-08 17:04:31:170107 [NOTICE] MRCP Server Started

附(下面这行不用)

LD_LIBRARY_PATH=lib/ ./bin/unimrcpserver -c conf/dirlayout.xml -l 7

运行client

cd /opt/unimrcp/bin
LD_LIBRARY_PATH=/usr/local/lib/ ./umc

结果

2024-04-08 17:08:05:945658 [NOTICE] MRCP Client Started
2024-04-08 17:08:05:945694 [INFO]   Enter Directory [/opt/unimrcp/conf/umc-scenarios]
2024-04-08 17:08:05:945779 [INFO]   Load Scenario Name [synth] Class [Synthesizer]
2024-04-08 17:08:05:945869 [INFO]   Load Scenario Name [recog] Class [Recognizer]
2024-04-08 17:08:05:945936 [INFO]   Load Scenario Name [dtmf] Class [DtmfRecognizer]
2024-04-08 17:08:05:945983 [INFO]   Load Scenario Name [rec] Class [Recorder]
2024-04-08 17:08:05:946032 [INFO]   Load Scenario Name [verify] Class [Verifier]
2024-04-08 17:08:05:946088 [INFO]   Load Scenario Name [params] Class [Params]

自测

# 语音合成
run synth

# 语音识别
run recog

# DTMF识别
run dtmf

# speech recorder
run rec

# speech verification
run verify

结果

run synth

2024-04-08 18:37:57:238890 [INFO]   Send MRCPv2 Data 10.177.57.114:38126 <-> 10.177.57.114:1544 [295 bytes]
MRCP/2.0 295 SPEAK 1
Channel-Identifier: 104869e6f59411ee@speechsynth
Content-Type: application/synthesis+ssml
Content-Length: 158

<?xml version="1.0"?>
<speak version="1.0" xml:lang="en-US" xmlns="http://www.w3.org/2001/10/synthesis">
  <p>
    <s>Welcome to Uni MRCP.</s>
  </p>
</speak>
2024-04-08 18:37:57:239312 [INFO]   Receive MRCPv2 Data 10.177.57.114:38126 <-> 10.177.57.114:1544 [83 bytes]
MRCP/2.0 83 1 200 IN-PROGRESS
Channel-Identifier: 104869e6f59411ee@speechsynth

run recog

2024-04-08 18:37:30:069858 [INFO]   Receive MRCPv2 Data 10.177.57.114:32984 <-> 10.177.57.114:1544 [393 bytes]
MRCP/2.0 393 RECOGNITION-COMPLETE 2 COMPLETE
Channel-Identifier: ff4a16e4f59311ee@speechrecog
Completion-Cause: 000 success
Content-Type: application/x-nlsml
Content-Length: 208

<?xml version="1.0"?>
<result>
  <interpretation grammar="session:[email protected]" confidence="0.97">
    <instance>one</instance>
    <input mode="speech">one</input>
  </interpretation>
</result>

参考

  1. MRCP