I was trying to do a Java Binding on pocketsphinx for its Speech Recognition Features (I used aar method), it seems that i successfully done the Java Binding Part (no errors), but then it crashed after i called:
Assets assets = new Assets(this);
File assetDir = assets.SyncAssets();
SpeechRecognizer recognizer = SpeechRecognizerSetup.DefaultSetup().SetAcousticModel(new File(assetsDir,"sync/en-us-ptm")).SetKeywordThreshold(1e-20f).SetDictionary(new Java.IO.File(assetsDir,"sync/cmudict-en-us.dict")).Recognizer;
recognizer.AddListener(this);
What i already found is the error is on the line :
File assetDir = assets.SyncAssets();
Where the SyncAssets() method need Assets.lst. How do I auto generate the Assets.lst like in the : PocketSphinx for Android tutorial or does anyone have any other java binding method that works?
Thank you
So I tried several method, and one working for me is :
Install Android Studio and SDK
Open the pocketsphinx demo project on Android Studio
And also my method of creating the recognizer is wrong. It should be :
SpeechRecognizerSetup.DefaultSetup().SetAcousticModel(new File(assetDir,"en-us-ptm")).SetKeywordThreshold(1e-20f).SetDictionary(new Java.IO.File(assetDir,"cmudict-en-us.dict")).Recognizer;
(without sync/)
Special Note : You have to put all the assets for pocketsphinx on sync folder Click to see the Image