Speech to Text Include speech engine in apk

心不动则不痛 提交于 2019-12-22 11:08:57

问题


I need a speech to text facility in my app for Really non-Geeks. Is there a way to include the speech engine at compile time for all sorts of tablets?


回答1:


You could include your own engine, like the CMU Sphinx Engine. This has also the advantage of working without a data connection.

See this post on how to install it on Android - however you have to change the Android.mk : Reverse the order of LOCAL_STATIC_LIBRARIES so the line looks like this:

LOCAL_STATIC_LIBRARIES := pocketsphinx sphinxlm sphinxfeat sphinxfe sphinxutil

Otherwise the NDK will fail to build the package.




回答2:


There are 3 (three!) such Android.mk files in the build tree:

  1. CMUSphinx\AndroidPocketSphinx-master\bin\classes\Android.mk
  2. CMUSphinx\AndroidPocketSphinx-master\jni\Android.mk
  3. CMUSphinx\pocketsphinx-0.8\swig\Android.mk

The first 2 files (#1 & #2) already come in the order specified by @Force:

LOCAL_STATIC_LIBRARIES := pocketsphinx sphinxlm sphinxfeat sphinxfe sphinxutil

The 3rd one has a different order:

LOCAL_STATIC_LIBRARIES := sphinxutil sphinxfe sphinxfeat sphinxlm pocketsphinx

This works out of the box! That is, no need to change anything.

This refers to the package downloaded in April 2013, so perhaps an older download did require the aforementioned change.



来源:https://stackoverflow.com/questions/8644650/speech-to-text-include-speech-engine-in-apk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!