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的设置。这包括指定搜索模式(例如关键词识别或自由格式语音识别...
linux基础进阶笔记,配套视频:https://www.bilibili.com/list/474327672?sid=4493093&spm_id_from=333.999.0.0&desc=1
IMG20241115211541.jpg
GEE训练教程——Landsat5、8和Sentinel-2、DEM和各2哦想指数下载
该资源内项目源码是个人的课程设计、毕业设计,代码都测试ok,都是运行成功后才上传资源,答辩评审平均分达到96分,放心下载使用! ## 项目备注 1、该资源内项目代码都经过严格测试运行成功才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载学习,也适合小白学习进阶,当然也可作为毕设项目、课程设计、作业、项目初期立项演示等。 3、如果基础还行,也可在此代码基础上进行修改,以实现其他功能,也可用于毕设、课设、作业等。 下载后请首先打开README.md文件(如有),仅供学习参考, 切勿用于商业用途。
基于springboot家政预约平台源码数据库文档.zip
Ucharts添加stack和折线图line的混合图
基于springboot员工在线餐饮管理系统源码数据库文档.zip
新能源汽车进出口数据 1、时间跨度:2018-2020年 2、指标说明:包含如下指标的进出口数据:混合动力客车(10座及以上)、纯电动客车(10座及以上)、非插电式混合动力乘用车、插电式混合动力乘用车、纯电动乘用车 二、新能源汽车进出口月销售数据(分地区、分类型、分 级别) 1、数据来源:见资料内说明 2、时间跨度:2014年1月-2021年5月 4、指标说明: 包含如下指标 2015年1月-2021年5月新能源乘用车终端月度销量(分类型)部分内容如下: 新能源乘用车(单月值、累计值 )、插电式混合动力 月度销量合计(狭义乘用车轿车、SUV、MPV、交叉型乘用车); 月度销量同比增速(狭义乘用车轿车、SUV、MPV、交叉型乘用车); 累计销量合计(狭义乘用车轿车、SUV、IPV、交叉型乘用车); 累计销量同比增速(狭义乘用车轿车、SUV、MPV、交叉型乘用车); 累计结构变化(狭义乘用车轿车、SUV、IPV、交叉型乘用车); 2015年1月-2021年5月新能源乘用车终端月度销量(分地区)内容如下: 更多见资源内
中心主题-241121215200.pdf
内容概要:本文档提供了多个蓝奏云下载链接及其对应解压密码,帮助用户快速获取所需文件。 适合人群:需要从蓝奏云下载文件的互联网用户。 使用场景及目标:方便地记录并分享蓝奏云上文件的下载地址和密码,提高下载效率。 阅读建议:直接查看并使用提供的链接和密码即可。若遇到失效情况,请尝试联系上传者确认更新后的链接。
基于Java web 实现的仓库管理系统源码,适用于初学者了解Java web的开发过程以及仓库管理系统的实现。
资源名称:Python-文件重命名-自定义添加文字-重命名 类型:windows—exe可执行工具 环境:Windows10或以上系统 功能: 1、点击按钮 "源原文"【浏览】表示:选择重命名的文件夹 2、点击按钮 "保存文件夹"【浏览】表示:保存的路径(为了方便可选择保存在 源文件中 ) 3、功能①:在【头部】添加自定义文字 4、功能②:在【尾部】添加自定义文字 5、功能③:输入源字符 ;输入替换字符 可以将源文件中的字符替换自定义的 6、功能④:自动加上编号_1 _2 _3 优点: 1、非常快的速度! 2、已打包—双击即用!无需安装! 3、自带GUI界面方便使用!
JDK8安装包
配合作者 一同使用 作者地址没有次下载路径 https://blog.csdn.net/weixin_52372189/article/details/127471149?fromshare=blogdetail&sharetype=blogdetail&sharerId=127471149&sharerefer=PC&sharesource=weixin_45375332&sharefrom=from_link
GEE训练教程
该资源内项目源码是个人的课程设计、毕业设计,代码都测试ok,都是运行成功后才上传资源,答辩评审平均分达到96分,放心下载使用! ## 项目备注 1、该资源内项目代码都经过严格测试运行成功才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载学习,也适合小白学习进阶,当然也可作为毕设项目、课程设计、作业、项目初期立项演示等。 3、如果基础还行,也可在此代码基础上进行修改,以实现其他功能,也可用于毕设、课设、作业等。 下载后请首先打开README.md文件(如有),仅供学习参考, 切勿用于商业用途。
基于springboot交通感知与车路协同系统源码数据库文档.zip
基于springboot+vue 雅妮电影票购买系统源码数据库文档.zip
为了更好地理解 HTML5 的拖放功能,我们设计了一个简单有趣的示例:将水果从水果区拖放到购物笼中,实时更新数量和价格,并在所有水果被成功放置后,播放音效并显示提示。