问题
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:
- CMUSphinx\AndroidPocketSphinx-master\bin\classes\Android.mk
- CMUSphinx\AndroidPocketSphinx-master\jni\Android.mk
- 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