Menu

Can't locate resource:/edu/cmu/sphinx/models/en-us/en-us

Kelly
2016-03-12
2016-05-12
  • Kelly

    Kelly - 2016-03-12

    Hi

    I have been having trouble running Sphinx on Android using JavaFX with the Eclipse IDE.
    I have been getting a resoruce not found error.

    Property exception component:'acousticModelLoader' property:'location' - Can't locate resource:/edu/cmu/sphinx/models/en-us/en-us

    Here is a image of my project layout in Eclipse.

    My build.gradle file has the following lines

    dependencies {
        compile group: 'edu.cmu.sphinx', name: 'sphinx4-core', version:'5prealpha-SNAPSHOT'
        compile group: 'edu.cmu.sphinx', name: 'sphinx4-data', version:'5prealpha-SNAPSHOT'
        compile 'com.gluonhq:charm-down-common:1.0.0'
    
        androidRuntime 'com.gluonhq:charm-down-android:1.0.0'
    
        desktopRuntime 'com.gluonhq:charm-down-desktop:1.0.0'
    }
    
    repositories {
        jcenter()
        mavenLocal()
        maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
    }
    

    The program runs but fails at the LiveSpeechRecognizer line.

    private static final String ACOUSTIC_MODEL = "resource:/edu/cmu/sphinx/models/en-us/en-us";
    private static final String DICTIONARY_PATH = "resource:/edu/cmu/sphinx/models/en-us/cmudict-en-us.dict";
    pivate static final String GRAMMAR_PATH = "resource:/com/varv";
    rivate static final String LANGUAGE_MODEL = "resource:/edu/cmu/sphinx/models/en-us/en-us.lm.bin";
    
    Configuration configuration = new Configuration();
        configuration.setAcousticModelPath(ACOUSTIC_MODEL);
        configuration.setDictionaryPath(DICTIONARY_PATH);
        configuration.setGrammarPath(GRAMMAR_PATH);
        configuration.setUseGrammar(true);
    
        configuration.setGrammarName("varv");
        LiveSpeechRecognizer jsgfRecognizer = new LiveSpeechRecognizer(configuration);
    

    I have tried several ways to solve this problem, been working on it for the last 2 days.

    Thanks for your help.

     
    • Nickolay V. Shmyrev

      Sphinx4 is too slow for android, you can use pocketsphinx, tutorial is here

      http://cmusphinx.sourceforge.net/wiki/tutorialandroid

       

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.