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的设置。这包括指定搜索模式(例如关键词识别或自由格式语音识别...
ruoyi-vue-pro-vben 芋道管理后台,基于 vben 最新版本,最新的 vue3 vite4 ant-design-vue 4.0 typescript 语法进行重构开发,支持 springboot3 springcloud 版本
那些年,与你同分同位次的同学都去了哪里?全国各大学在四川2020-2024年各专业最低录取分数及录取位次数据,高考志愿必备参考数据
yolo系列算法目标检测数据集,包含标签,可以直接训练模型和验证测试,数据集已经划分好,适用yolov5,yolov8,yolov9,yolov7,yolov10,yolo11算法; 包含两种标签格:yolo格式(txt文件)和voc格式(xml文件),分别保存在两个文件夹中; yolo格式:<class> <x_center> <y_center> <width> <height>, 其中: <class> 是目标的类别索引(从0开始)。 <x_center> 和 <y_center> 是目标框中心点的x和y坐标,这些坐标是相对于图像宽度和高度的比例值,范围在0到1之间。 <width> 和 <height> 是目标框的宽度和高度,也是相对于图像宽度和高度的比例值
该项目是一个基于Java语言开发的水果管理系统设计源码,包含53个文件,其中包括30个Java源文件、13个XML配置文件、6个JAR包文件、1个Git忽略文件、1个属性文件以及1个SQL脚本文件。此系统旨在用于期末答辩展示,展示了开发者对Java编程和系统设计的深入理解。
java回顾、知识整理、拾遗、面试_java-review
mysql主从复制用struts2,spring,hibernate框架,搭建在线考试系统。网站支持(1)老师创建题库,创建题目,查看题目对题目进行增删改,发布考试(选择考试难中易比例),批改学生试卷,查看学生成绩。(.zip
一个基于Go语言实现的搜索引擎项目资源
那些年,与你同分同位次的同学都去了哪里?全国各大学在四川2020-2024年各专业最低录取分数及录取位次数据,高考志愿必备参考数据
基于grpc开发的跨语言的交互系统,集成BCS,Brower
那些年,与你同分同位次的同学都去了哪里?全国各大学在四川2020-2024年各专业最低录取分数及录取位次数据,高考志愿必备参考数据
那些年,与你同分同位次的同学都去了哪里?全国各大学在四川2020-2024年各专业最低录取分数及录取位次数据,高考志愿必备参考数据
那些年,与你同分同位次的同学都去了哪里?全国各大学在四川2020-2024年各专业最低录取分数及录取位次数据,高考志愿必备参考数据
基于go语言,使用gocv和socket实现摄像头视频传输项
apache-seatunnel-web-1.0.2
内容概要:本篇文章主要介绍了如何在VMware虚拟化平台上搭建并配置QNX Neutrino实时操作系统的步骤方法。文章首先给出了获取必要的安装文件来源,然后逐步指导用户如何完成QNX在虚拟机中的安装过程以及相关网络参数配置,包括选择适当的网络模式来实现宿主机器与QNX虚拟机之间的通信,具体为设置NAT模式或者桥接模式下的网络参数,如指定静态或动态获取IP地址的方法。 适用人群:对嵌入式开发感兴趣的技术人士,尤其是需要在Linux环境下开展工作的程序员和系统工程师。 使用场景及目标:通过详细的操作指南帮助初学者快速掌握在Windows或Linux主机上利用虚拟机搭建QNX Real-Time Operating System开发环境的基础技能,能够实现在该环境中运行简单的C/C++应用程序。 其他说明:本文不仅适用于QNX初学者作为入门引导资料,也为经验丰富的开发者提供了有关于特定环境配置的重要参考。由于涉及到的具体细节比较多,读者最好边操作边对照文章内容进行练习。同时要注意保持最新版本的虚拟化平台客户端和服务端程序以确保兼容性和稳定性。
stm32中dma结合ad的使用
yolo系列算法目标检测数据集,包含标签,可以直接训练模型和验证测试,数据集已经划分好,适用yolov5,yolov8,yolov9,yolov7,yolov10,yolo11算法; 包含两种标签格:yolo格式(txt文件)和voc格式(xml文件),分别保存在两个文件夹中; yolo格式:<class> <x_center> <y_center> <width> <height>, 其中: <class> 是目标的类别索引(从0开始)。 <x_center> 和 <y_center> 是目标框中心点的x和y坐标,这些坐标是相对于图像宽度和高度的比例值,范围在0到1之间。 <width> 和 <height> 是目标框的宽度和高度,也是相对于图像宽度和高度的比例值
低全球变暖潜能值 (GWP) 制冷剂.docx
那些年,与你同分同位次的同学都去了哪里?全国各大学在四川2020-2024年各专业最低录取分数及录取位次数据,高考志愿必备参考数据