Hi,
I integrated the library pocketsphinx-android-5prealpha lib.jar-no in my project so as described in the Wiki, everything works fine.
I need some clarification on its functioning.
In particular, I wanted to know you can start the reconnaissance without udare a keyword? I mean you can directly start continuous reconnaissance as well as works OpenEars on Ios? so that the user can continue to inpartire commands without having to utter the keyword-activation?
I hope someone can help me, rigraziandovi advance I offer my greetings.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Nicolay Hello and thanks for the reply.
Forgive me but I can not understand this passage.
This I have to do it in setupRecognizer?
private void setupRecognizer(File assetsDir) throws IOException {
// The recognizer can be configured to perform multiple searches
// of different kind and switch between them
recognizer = defaultSetup()
.setAcousticModel(new File(assetsDir, "en-us-ptm"))
.setDictionary(new File(assetsDir, "cmudict-en-us.dict"))
// To disable logging of raw audio comment out this call (takes a lot of space on the device)
.setRawLogDir(assetsDir)
// Threshold to tune for keyphrase to balance between false alarms and misses
.setKeywordThreshold(1e-45f)
// Use context-independent phonetic search, context-dependent is too slow for mobile
.setBoolean("-allphone_ci", true)
.getRecognizer();
recognizer.addListener(this);
/** In your application you might not need to add all those searches.
* They are added here for demonstration. You can leave just one.
*/
// Create keyword-activation search.
recognizer.addKeyphraseSearch(KWS_SEARCH, KEYPHRASE);
// Create grammar-based search for selection between demos
File menuGrammar = new File(assetsDir, "menu.gram");
recognizer.addGrammarSearch(MENU_SEARCH, menuGrammar);
// Create grammar-based search for digit recognition
File digitsGrammar = new File(assetsDir, "digits.gram");
recognizer.addGrammarSearch(DIGITS_SEARCH, digitsGrammar);
// Create language model search
File languageModel = new File(assetsDir, "weather.dmp");
recognizer.addNgramSearch(FORECAST_SEARCH, languageModel);
// Phonetic search
File phoneticModel = new File(assetsDir, "en-phone.dmp");
recognizer.addAllphoneSearch(PHONE_SEARCH, phoneticModel);
}
How should I change it to get recognition without keyword-activation search?
Thank you.
Last edit: Alessandro 2016-02-18
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
newAsyncTask<Void,Void,Exception>(){@OverrideprotectedExceptiondoInBackground(Void...params){try{Assetsassets=newAssets(PocketSphinxActivity.this);FileassetDir=assets.syncAssets();setupRecognizer(assetDir);}catch(IOExceptione){returne;}returnnull;}@OverrideprotectedvoidonPostExecute(Exceptionresult){if(result!=null){((TextView)findViewById(R.id.caption_text)).setText("Failed to init recognizer "+result);}else{switchSearch(FORECAST_SEARCH);}}}.execute();......privatevoidsetupRecognizer(FileassetsDir)throwsIOException{recognizer=defaultSetup().setAcousticModel(newFile(assetsDir,"en-us-ptm")).setDictionary(newFile(assetsDir,"cmudict-en-us.dict"))//Todisableloggingofrawaudiocommentoutthiscall(takesalotofspaceonthedevice).setRawLogDir(assetsDir).getRecognizer();recognizer.addListener(this);//CreatelanguagemodelsearchFilelanguageModel=newFile(assetsDir,"weather.dmp");recognizer.addNgramSearch(FORECAST_SEARCH,languageModel);}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I integrated the library pocketsphinx-android-5prealpha lib.jar-no in my project so as described in the Wiki, everything works fine.
I need some clarification on its functioning.
In particular, I wanted to know you can start the reconnaissance without udare a keyword? I mean you can directly start continuous reconnaissance as well as works OpenEars on Ios? so that the user can continue to inpartire commands without having to utter the keyword-activation?
I hope someone can help me, rigraziandovi advance I offer my greetings.
Yes, you can. You can select any type of search from the start in the code.
Nicolay Hello and thanks for the reply.
Forgive me but I can not understand this passage.
This I have to do it in setupRecognizer?
How should I change it to get recognition without keyword-activation search?
Thank you.
Last edit: Alessandro 2016-02-18
Thank you so much great !