前言:大家好,这是我的第二篇博文。上一篇介绍了一下在Linux环境下实现android的离线语音识别,本文主要说一下如何将这个工程成功地在Windows下运行起来。还是那句话,我所涉及的范围只是“应用”,由于时间的关系,对于一些原理性的东西我确实没有弄明白,我只是要求能够跑通,能够实现成功地的识别的目的。我会将一些我不懂的问题在下边一一列出来,有时间我一定尽力把它的原理弄明白。另外,上一篇中我引用了许多链接,虽然方便了,但我感觉不如自己写出来对自己以后发展更有帮助,很容易就忘掉了,所以,在这一次我争取把我所从事的试验、尝试和所遇到的问题都写出来,希望帮到别人同时也提醒自己不要忘掉。
我对这一个工程的理解:在我看来,这一工程实际上就是一个通过jni编程调用微软写的sphinx和pocketsphinx函数库(这两个库都是C语言写的),然后通过声学模型分析录入的语音,根据分析出的特性在数据字典中寻找匹配的文字。主要用到的知识应该就是jni交叉语言编程,其实质也就是通过NDK,借助这两个函数库编译出最终的.so文件。(当然,这其中也包括用到swig将c 接口转java 并生成java类,这个我不太懂就不说了)最终的android程序也就是要通过这个.so文件去实现识别功能,android终究是linux的程序,它还是要依托linux下的共享函数库即.so文件而不是windows下的.dll文件。