unimrcp项目github地址:https://github.com/unispeech/unimrcp
1. 源码下载:git clone https://github.com/unispeech/unimrcp.git
2. 依赖包下载地址:http://www.unimrcp.org/downloads/dependencies
3. 解压进入依赖包目录, 并执行命令安装依赖, 安装途中会有选项弹出是否编译xxx, 按y回车选择编译:./build-dep-libs.sh
4. 安装其他工具:sudo apt install -y autoconf audomake libtool gcc pkg-config
5.安装好之后进入unimrcp源码目录运行如下命令以生成configure和其他必要文件:./bootstrap
6.生成configure配置文件后, 运行如下命令:./configure.
7. 打开configure.ac配置文件添加如下内容:dnl syzn recognizer plugin.
UNI_PLUGIN_ENABLED(syznrecog)
AM_CONDITIONAL([SYZNRECOG_PLUGIN],[test "${enable_syznrecog_plugin}" = "yes"])
...
plugins/syzn-recog/Makefile
...
echo Syzn Recognizer plugin........ : $enable_syznrecog_plugin
8.进入plugins目录,新建syzn-recog目录:cd plugins
mkdir syzn-recog
mkdir syzn-recog/src
9.将demo-recog/src目录下的demo_recog_engine.c拷贝到syzn-recog/src目录下:cp ./demo-recog/src/demo_recog_engine.c ./syzn-recog/src/
10.重命名为syzn_recog_engine.c, 并将里面的demo全部查找替换为syzn:mv ./syzn-recog/src/demo_recog_engine.c ./syzn-recog/src/syzn_recog_engine.c
11.在syzn-recog目录目录下新建Makefile.am并打开文件:cd syzn-recog
touch Makefile.am
nano Makefile.am
写入如下内容:AM_CPPFLAGS = $(UNIMRCP_PLUGIN_INCLUDES)
plugin_LTLIBRARIES = syznrecog.la
syznrecog_la_SOURCES = src/syzn_recog_engine.c
syznrecog_la_LDFLAGS = $(UNIMRCP_PLUGIN_OPTS) \
-L$(top_srcdir)/plugins/syzn-recog/src/ \
-lsynetapi
syznrecog_ladir = $(libdir)
syznrecog_la_DATA = $(top_srcdir)/plugins/syzn-recog/src/libsynetapi.so
include $(top_srcdir)/build/rules/uniplugin.am
UNIMRCP_PLUGIN_INCLUDES += -I$(top_srcdir)/plugins/syzn-recog/src
按ctrl+o保存,再按ctrl+x退出编辑, 把libsynetapi.so和synetapi.h文件拷贝到syzn-recog/src/目录下
12. 返回到plugins目录, 打开Makefile.am文件:cd ..
nano Makefile.am
将如下内容添加到文件中:if SYZNRECOG_PLUGIN
SUBDIRS += syzn-recog
endif
13.返回到unimrcp源码根目录, 重新执行如下命令:./bootstrap
./configure
14.编译源码:make
15:安装unimrp:sudo make install
16.进入/usr/local/unimrcp/conf目录并打开cd /usr/local/unimrcp/conf
sudo nano unimrcpserver.xml
找到如下位置:
添加这一句:
并将上面四个自带插件的enbale属性设置为false, 按ctrl+o保存,ctrl+x退出编辑:
17. 进入/usr/local/unimrcp/bin目录, 打开mrcp服务器:cd /usr/local/unimrcp/bin
./unimrcpserver