Menu

Change "oh my computer" to any other custom text

Help
Amit Kumar
2015-05-16
2017-12-04
  • Amit Kumar

    Amit Kumar - 2015-05-16

    Can we change "oh mighty computer" to any other text

     

    Last edit: Amit Kumar 2015-05-16
    • Nickolay V. Shmyrev

      Yes

       
  • akash suresh bhajani

    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..

     
    • Nickolay V. Shmyrev

      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.

       
  • akash suresh bhajani

    I have change my phrase.gram file format.

    JSGF V1.0;

            grammar phrase;
    
           <phrase> = please save me;
    
           public <command> = <phrase>;
    

    I hope this will be the proper grammer file formate, I have taken reference of digit.gram file from pocket-sphinx demo

     
  • akash suresh bhajani

    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".

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.