This is done with CMUSphinx 0.7 (so sphinxbase 0.7 and pocketsphinx 0.7). The files are archived at the end of the article. The process also require access to a linux machine and the Eclipse IDE.
- Download Sphinx base and pocket sphinx (http://cmusphinx.sourceforge.net/wiki/download/ )
- Create a directory somewhere, untar both to ./sphinxbase and ./pocketsphinx (lose the -0.x version suffix)
- For each of the two, do the usual ./autogen.sh ./configure, make, make install (make install require root)
- Check ./pocketsphinx/swig has libpocketsphinx_jni.so in it. If not, do a make in that directory
- Download the PocketSpinxAndroiDemo
- untar it to the same directory created in 2
- cp -r ./pocketsphinx/swig/edu ./PocketSphinxAndroidDemo/jni/
- cd ./PocketSphinxAndroidDemo/jni/
- Update SPHINX_PATH to the directory created in 2
- Open Android.mk, edit LOCAL_STATIC_LIBRARIES from whatever it was before to “pocketsphinx sphinxlm sphinxfeat sphinxfe sphinxutil” (without qoutes)
- Install Android NDK (http://developer.android.com/sdk/ndk/index.html )
- stay in the jni directory, do a ndk-build (see the ndk link about for instructions on building if it is not clear)
Now we are ready to open this in Eclipse
- Open eclipse and import the project, ignore any build warnings/errors
- Untick Project -> Build Automatically (This is personal choice, since the JNI build process is heavy I dont like it building all the time)
- Project -> Properties -> Builders
- Select SWIG -> Edit -> for Working Directory, select Browse Workspace and pick the jni directory, In the Refresh tab, select The folder containing the selected resource, in Build Options, untick Specify working set of relevant resources (This option may be hidden in the dialog, if you dont see it, maximize the Configuration window).
- Select NDK build -> Edit -> Set the correct location for ndk-build, select the correct Working directory (Browse workspace and then select the jni directory). In the Refresh tab, select The project containing the selected resource, in Build Options, untick Specify working set of relevant resources (This option may be hidden in the dialog, if you dont see it, maximize the Configuration window).
- Project -> Build Project. If you see any errors, check that step 4 and 5 are carried out correctly. The project should build without error. A console may appear with red texts, just confirm that they are warning messages from building the c code and you should be ok
We should now have a built Android application ready for testing
- In the emulator (or phone), create under primary storage (whatever is returned by the getExternalStorageDirectory). For example if you have a sdcard this would be /mnt/sdcard
- If using the emulator, call adb shell from a console window, and use mkdir command for the step below (to create directories on the emulator)
- Create directory structure: Android/edu.cmu.pocketsphinx/hmm/en_US/hub4wsj_sc_8k, Android/edu/edu.cmu.pocketsphinx/lm/en_US/
- Copy pocketsphinx/model/hmm/en_US/hub4wsj_sc_8k/* into the emulator/phone
- Copy pocketsphinx/model/lm/en_US/* into emulator/phone
- In eclipse, open the RecognizerTask.java file, look for c.setString(“-lm”
- Make sure the files loaded in the code around step 6 exists (especially the .dict file may have a different name)
- Now we can run the application!
If the app crashes for any reason, go to sdcard/Android/edu.cmu.pocketsphinx and there should be a log file (pocketsphinx.log) from the native library.
Misc thought
- On my machine (OpenSuSE 11.3) the swig directory was empty after make. Go into swig directory and call make, the errors will be displayed (for me it was because I didn’t have swig installed)
- By default make install installs to /usr/local/lib which can cause problems on some systems. If you get errors with any of the sphinx stuff saying some library is not found, use the ldd and strace commands to see where they are looking for the libs, and symlink them. Alternatively supply another install location to make install
- While working in eclipse, if you see any errors along the lines of “Refresh scope invalid”, check step 4 and 5 are carried out from the Eclipse section above.
Files required **Before downloading these archives, try using the latest build from the official website first**:
相关推荐
Pocketsphinx的Android版本包含了所有必要的库和资源,包括声学模型、语言模型以及字典,这些都是识别语音所必需的。 接着,你需要配置Pocketsphinx的设置。这包括指定搜索模式(例如关键词识别或自由格式语音识别...
"SMART 200系列地址库:灵活配置的位读写系统",SMART 200 寻址-库 6个子 位:一个读,一个写 读:例如 读取从V0.0开始的第N个位的状态 写:例如 将值写入V0.0开始的第N个位中 起始地址和第几个位都可自定义 字节:读写一体,引脚控制读或写 字:读写一体,引脚控制读或写 双字:读写一体,引脚控制读或写 实数:读写一体,引脚控制读或写 ,核心关键词:SMART 200; 寻址-库; 子位; 读; 写; 起始地址; 自定义; 字节; 字; 双字; 实数。,"SMART 200库:位寻址与多读写功能"
1、文件内容:perl-ExtUtils-Manifest-1.61-244.el7.rpm以及相关依赖 2、文件形式:tar.gz压缩包 3、安装指令: #Step1、解压 tar -zxvf /mnt/data/output/perl-ExtUtils-Manifest-1.61-244.el7.tar.gz #Step2、进入解压后的目录,执行安装 sudo rpm -ivh *.rpm 4、安装指导:私信博主,全程指导安装
多水下航行器协同定位的MATLAB仿真:基于《Cooperative Localization for Autonomous Underwater Vehicles》的研究与实践,【7】MATLAB仿真 多水下航行器协同定位,有参考文档。 主要参考文档: 1. Cooperative Localization for Autonomous Underwater Vehicles,The International Journal of Robotics Research 主要供文档方法的学习 非全文复现。 ,MATLAB仿真; 多水下航行器协同定位; 参考文档; 自主水下航行器; 机器人学国际期刊; Cooperative Localization。,MATLAB仿真:多水下航行器协同定位研究参考国际期刊论文
基于大语言模型的多模态社交媒体信息流行度预测研究
1、文件内容:perl-Algorithm-Diff-1.1902-17.el7.rpm以及相关依赖 2、文件形式:tar.gz压缩包 3、安装指令: #Step1、解压 tar -zxvf /mnt/data/output/perl-Algorithm-Diff-1.1902-17.el7.tar.gz #Step2、进入解压后的目录,执行安装 sudo rpm -ivh *.rpm 4、安装指导:私信博主,全程指导安装
《基于分时电价下电动汽车多类型充放电调度策略优化及其经济与负荷曲线改善分析》,11-分时电价下电动汽车充放电调度策略优化-100% 摘要:代码主要做的是分时电价下电动汽车充放电策略的优化,电动汽车选取了四种典型的类型,包括比亚迪EV,尼桑EV,宝马mini以及三菱EV,四种类型电动汽车取若干辆,约束重点关注充放电约束、蓄电量约束、0-1启停约束等等,目标函数为经济效益最优,同时考虑负荷曲线的改善,并通过图展示其结果,具体看下图。 ,核心关键词: 分时电价; 电动汽车; 充放电策略优化; 类型; 约束; 经济效益; 负荷曲线改善; 图展示。,电价优化下电动汽车充放电调度策略研究
IMG_20250130_120659.jpg
该项目是一款基于JavaScript、TypeScript和微信小程序开发的火车票购票系统源码,包含1634个文件,涵盖395个JavaScript文件、293个TypeScript文件、271个JSON配置文件、240个WXML模板文件、232个WXSS样式文件、138个WXS脚本文件,并辅以22个PNG图片、19个Markdown文档和1个JPG图片。该系统旨在提供便捷的火车票购票服务。
驱动DHT11要学会看数据手册
《COMSOL模拟增强型地热开采采热井温度变化一年周期的瞬态分析》,comsol增强型地热开采 本模型采用达西定律接口、多孔介质传热接口、非等温管道流接口,采用瞬态求解器,求解采热井一年的温度变化 ,comsol; 增强型地热开采; 达西定律接口; 多孔介质传热接口; 非等温管道流接口; 瞬态求解器; 采热井温度变化,《COMSOL模型在地热开采中模拟采热井一年温度变化的研究》
0016-08-16122503-曾洋.zip
1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。
week01_lab_solutions.ipynb
免费JAVA毕业设计 2024成品源码+论文+录屏+启动教程 启动教程:https://www.bilibili.com/video/BV1SzbFe7EGZ 项目讲解视频:https://www.bilibili.com/video/BV1Tb421n72S 二次开发教程:https://www.bilibili.com/video/BV18i421i7Dx
Golang. KisFlow(Keep It Simple Flow).
免费JAVA毕业设计 2024成品源码+论文+录屏+启动教程 启动教程:https://www.bilibili.com/video/BV1SzbFe7EGZ 项目讲解视频:https://www.bilibili.com/video/BV1Tb421n72S 二次开发教程:https://www.bilibili.com/video/BV18i421i7Dx
1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。
1、文件内容:perl-B-Keywords-1.13-2.el7.rpm以及相关依赖 2、文件形式:tar.gz压缩包 3、安装指令: #Step1、解压 tar -zxvf /mnt/data/output/perl-B-Keywords-1.13-2.el7.tar.gz #Step2、进入解压后的目录,执行安装 sudo rpm -ivh *.rpm 4、安装指导:私信博主,全程指导安装
1、文件内容:perl-Net-DNS-Nameserver-0.72-6.el7.rpm以及相关依赖 2、文件形式:tar.gz压缩包 3、安装指令: #Step1、解压 tar -zxvf /mnt/data/output/perl-Net-DNS-Nameserver-0.72-6.el7.tar.gz #Step2、进入解压后的目录,执行安装 sudo rpm -ivh *.rpm 4、安装指导:私信博主,全程指导安装