How can I add my commands.txt file to assets/sync/.. ?
Just put the file in the folder
I thought adding to models dir is enough, but i need a md5?
MD5 is created automatically with a custom builder. You need to have Java Development installed in Eclipse and make sure that custom builder is properly imported when you import the project.
recognizer.addKeywordSearch(KWS_SEARCH, new File(modelsDir, "commands.txt"));
Log:
08-19 18:46:38.577: E/cmusphinx(26396): ERROR: "kws_search.c", line 349: Failed to open keyword file '/storage/emulated/0/Android/data/com.example.keywordrecognition/files/sync/models/commands.txt': No such file or directory
Just checked my sd-card, there is no commands.txt
Last edit: JuLoOr 2014-08-19
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello guys,
i tried the ps-android demo and it works perfekt for me.
Now I want to listen for more keywords. How can i do that?
My present code:
public class MainActivity extends Activity implements RecognitionListener {
Best regards Jul
Last edit: JuLoOr 2014-08-17
SpeechRecognizer#addKeywordSearch(String name, File file)
. The file should contain keyphrases, one per line.Nice, will try it later.
Thanks for your good help!!
Jul
How can I add my commands.txt file to assets/sync/.. ?
I thought adding to models dir is enough, but i need a md5?
Just put the file in the folder
MD5 is created automatically with a custom builder. You need to have Java Development installed in Eclipse and make sure that custom builder is properly imported when you import the project.
See for details
http://cmusphinx.sourceforge.net/wiki/tutorialandroid
Does not work:
recognizer.addKeywordSearch(KWS_SEARCH, new File(modelsDir, "commands.txt"));
Log:
08-19 18:46:38.577: E/cmusphinx(26396): ERROR: "kws_search.c", line 349: Failed to open keyword file '/storage/emulated/0/Android/data/com.example.keywordrecognition/files/sync/models/commands.txt': No such file or directory
Just checked my sd-card, there is no commands.txt
Last edit: JuLoOr 2014-08-19
Ok just found my mistake. You were right, I built the first time with the custom builder, but now it's gone. Can i add it afterwards?
Check this:
http://www.codejava.net/ides/eclipse/add-custom-ant-build-script-to-eclipse-project
Or, simple way, copy .externalToolBuilders folder and assets.xml from Pocketsphinx Android Demo project to your project.
Super nice !
Thanks for helping and the new learned stuff ! :-)
Jul