Menu

Error while trying out the tutorial for sphinx4

DavidK
2014-11-04
2014-11-04
  • DavidK

    DavidK - 2014-11-04

    I am following the tutorial at: http://cmusphinx.sourceforge.net/wiki/tutorialsphinx4

    I am looking to just use the default configuration but am getting an error with the language model. The exception is: java.io.FileNotFoundException: models\language\en-us.lm.dmp (The system cannot find the path specified).

    Is there a default model file available to me with the following two jars:
    sphinx4-core-1.0-SNAPSHOT.jar
    sphinx4-data-1.0-SNAPSHOT.jar

    My code looks like:

    public class SpeechAnalyzer {

    public static void main(String[] args) throws IOException, FileNotFoundException {
        /* Following the code at: http://cmusphinx.sourceforge.net/wiki/tutorialsphinx4 */
        /* Create configuration */
        Configuration configuration = createConfiguration();
                StreamSpeechRecognizer recognizer = new StreamSpeechRecognizer(configuration);
    
                InputStream fIS =  
                  SpeechAnalyzer.class.getClassLoader().getResourceAsStream("HappyAudio.wma");
                System.out.println("[SpeechAnalyzer] Starting recognition of the HappyAudio.wma file...");
                 recognizer.startRecognition(fIS);
                 SpeechResult result = recognizer.getResult();
                 recognizer.stopRecognition();
                 System.out.println("[SpeechAnalyzer] Stopped recognition of the HappyAudio.wma file");
    
    }
    
    private static Configuration createConfiguration() {
        Configuration configuration = new Configuration();
    
        /* Set path to acoustic model */
    
            //configuration.setAcousticModelPath("resource:/WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz");
        configuration.setAcousticModelPath("resource:/edu/cmu/sphinx/models/acoustic/wsj");
        /* Set path to dictionary */
    configuration.setDictionaryPath("resource:/edu/cmu/sphinx/models/acoustic/wsj/dict/cmudict.0.6d");
        /* Set language model */
        configuration.setLanguageModelPath("models/language/en-us.lm.dmp");
    
    
        return configuration;
    }
    

    }

     
    • Alexander Solovets

      It's resource:/edu/cmu/sphinx/models/language/en-us.lm.dmp, I've
      updated the wiki.

      On Wed, Nov 5, 2014 at 7:27 AM, DavidK upendyal@users.sf.net wrote:

      I am following the tutorial at: http://cmusphinx.sourceforge.net/wiki/tutorialsphinx4

      I am looking to just use the default configuration but am getting an error with the language model. The exception is: java.io.FileNotFoundException: models\language\en-us.lm.dmp (The system cannot find the path specified).

      Is there a default model file available to me with the following two jars:
      sphinx4-core-1.0-SNAPSHOT.jar
      sphinx4-data-1.0-SNAPSHOT.jar

      My code looks like:

      public class SpeechAnalyzer {

          public static void main(String[] args) throws IOException, FileNotFoundException {
                  /* Following the code at: http://cmusphinx.sourceforge.net/wiki/tutorialsphinx4 */
                  /* Create configuration */
                  Configuration configuration = createConfiguration();
                  StreamSpeechRecognizer recognizer = new StreamSpeechRecognizer(configuration);
      
                  InputStream fIS =
                    SpeechAnalyzer.class.getClassLoader().getResourceAsStream("HappyAudio.wma");
                  System.out.println("[SpeechAnalyzer] Starting recognition of the HappyAudio.wma file...");
                   recognizer.startRecognition(fIS);
                   SpeechResult result = recognizer.getResult();
                   recognizer.stopRecognition();
                   System.out.println("[SpeechAnalyzer] Stopped recognition of the HappyAudio.wma file");
      
          }
      
          private static Configuration createConfiguration() {
                  Configuration configuration = new Configuration();
      
                  /* Set path to acoustic model */
      
              //configuration.setAcousticModelPath("resource:/WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz");
              configuration.setAcousticModelPath("resource:/edu/cmu/sphinx/models/acoustic/wsj");
              /* Set path to dictionary */
          configuration.setDictionaryPath("resource:/edu/cmu/sphinx/models/acoustic/wsj/dict/cmudict.0.6d");
                  /* Set language model */
                  configuration.setLanguageModelPath("models/language/en-us.lm.dmp");
      
      
                  return configuration;
          }
      

      }


      Error while trying out the tutorial for sphinx4


      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/cmusphinx/discussion/sphinx4/

      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

      --
      Sincerely, Alexander

       

Log in to post a comment.

MongoDB Logo MongoDB