Hi Nockolay,
As per the guide lines I have change the hot word detection from "oh mighty computer" to "please save me".
My phrase is detecting whenever I speak the same.
But my problem is, my app detecting phrase even after the phrase havn't speaks out.
I have just tried a test, I have started a English song and kept my android device beside with running application,
Song don't have this "Please save me" phrase but my app is detecting it continuously.
Can you please help me to sort out this problem.
My Peace of code is here for recognizer setup.
private void setupRecognizer(File assetsDir) throws IOException {
// The recognizer can be configured to perform multiple searches
// of different kind and switch between them
recognizer = SpeechRecognizerSetup.defaultSetup()
.setAcousticModel(new File(assetsDir, "en-us-ptm"))
.setDictionary(new File(assetsDir, "cmudict-en-us.dict"))
.setKeywordThreshold(1e-45f)//added for threshold
//.setRawLogDir(assetsDir) // To disable logging of raw audio comment out this call (takes a lot of space on the device)
//setRawLogDir method I have commented.
.getRecognizer();
recognizer.addListener(this);
// Create grammar-based search for dialog recognition
File digitsGrammar = new File(assetsDir, "phrase.gram");
recognizer.addGrammarSearch(KWS_DIALOG, digitsGrammar);
recognizer.addKeyphraseSearch(KWS_DIALOG, KEYPHRASE);
}
My phrase.gram contain,
*please save me/1e-20/ *
Thanks in advance..
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I only need to detect single phrase so I am confuse do I need to even go for grammer file or only
recognizer.addKeyphraseSearch(KWS_DIALOG, KEYPHRASE);
work for me where KEYWORD will be "please save me".
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Can we change "oh mighty computer" to any other text
Last edit: Amit Kumar 2015-05-16
Yes
Hi Nockolay,
As per the guide lines I have change the hot word detection from "oh mighty computer" to "please save me".
My phrase is detecting whenever I speak the same.
But my problem is, my app detecting phrase even after the phrase havn't speaks out.
I have just tried a test, I have started a English song and kept my android device beside with running application,
Song don't have this "Please save me" phrase but my app is detecting it continuously.
Can you please help me to sort out this problem.
My Peace of code is here for recognizer setup.
My phrase.gram contain,
*please save me/1e-20/ *
Thanks in advance..
You need to tune the threshold first as described in tutorial http://cmusphinx.github.io/wiki/tutoriallm
You use phrase.gram in a wrong way, you use it with grammar search, not with keyword search. And grammar file has different format and purpose.
I have change my phrase.gram file format.
JSGF V1.0;
I hope this will be the proper grammer file formate, I have taken reference of digit.gram file from pocket-sphinx demo
I only need to detect single phrase so I am confuse do I need to even go for grammer file or only
recognizer.addKeyphraseSearch(KWS_DIALOG, KEYPHRASE);
work for me where KEYWORD will be "please save me".