Menu

Newbie Question

Anonymous
2015-12-17
2015-12-23
  • Anonymous

    Anonymous - 2015-12-17

    NEWBIE ALERT
    Hi,
    I am posting this question to both the Sphinx4 Help and the Help forums.
    I am uncertain which forum is appropriate.

    Background:
    On my Linux box (Debian), I would like to dictate my various notes and have them transcribed into text.
    I have a USB microphone (eBerry Plug and Play).

    Question:
    I understand that CMU Sphinx is not intended as an end-user tool; but can it be used in the capacity that I just mentioned?

    Finally, 2 other notes:
    1) I had great success with CMU's capture/playback tool (Sikuli) so I'm kind-of a CMU fan.
    2) Although I would like to use this as a simple, old end-user, I have plenty of software development experience.
    So if the converstation has to lean that way, I might be able to keep up..... :-)

    TIA and thanks for your patience,
    Matt

     
    • Nickolay V. Shmyrev

      Hello Matt

      You can try to use sphinx4, to get more details on how to use it, you can check our tutorial

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

       
      • Anonymous

        Anonymous - 2015-12-20

        Great, thanks for the reply.

         
  • Anonymous

    Anonymous - 2015-12-22

    Hello Again. Can anyoneone help me with the following compilation issue?
    I've included (copy/paste) the history/commands:

    /home/matthew/Software/Java/Projects/Sphinx/First : [706]
    
    ls -lisa
    total 79428
    37618506     4 drwxr-xr-x 2 matthew matthew     4096 Dec 22 09:29 .
    37492138     4 drwxr-xr-x 3 matthew matthew     4096 Dec 22 09:05 ..
    37620918  1232 -rw-r--r-- 1 matthew matthew  1259774 Dec 22 09:02 sphinx4-core-5prealpha-20151218.160007-5.jar
    37620919 36908 -rw-r--r-- 1 matthew matthew 37790849 Dec 22 09:03 sphinx4-data-5prealpha-20151218.160017-5.jar
    37620920     4 -rw-r--r-- 1 matthew matthew      261 Dec 22 09:03 sphinx4-parent-5prealpha-20151118.204517-1.jar
    37620921 40816 -rw-r--r-- 1 matthew matthew 41794378 Dec 22 09:04 sphinx4-samples-5prealpha-20151218.160038-4.jar
    37620916   456 -rw-r--r-- 1 matthew matthew   466916 Dec 22 08:26 test.wav
    37620917     4 -rw-r--r-- 1 matthew matthew     1256 Dec 22 09:28 TranscriberDemo.java
    
    /home/matthew/Software/Java/Projects/Sphinx/First : [707]
    
    cat TranscriberDemo.java
    package com.example;
    
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.InputStream;
    
    import edu.cmu.sphinx.api.Configuration;
    import edu.cmu.sphinx.api.SpeechResult;
    import edu.cmu.sphinx.api.StreamSpeechRecognizer;
    
    public class TranscriberDemo {       
    
        public static void main(String[] args) throws Exception {
    
            Configuration configuration = new Configuration();
    
            configuration
                    .setAcousticModelPath("resource:/edu/cmu/sphinx/models/en-us/en-us");
            configuration
                    .setDictionaryPath("resource:/edu/cmu/sphinx/models/en-us/cmudict-en-us.dict");
            configuration
                    .setLanguageModelPath("resource:/edu/cmu/sphinx/models/en-us/en-us.lm.bin");
    
            StreamSpeechRecognizer recognizer = new StreamSpeechRecognizer(
                    configuration);
            InputStream stream = new FileInputStream(new File("test.wav"));
    
            recognizer.startRecognition(stream);
            SpeechResult result;
            while ((result = recognizer.getResult()) != null) {
                System.out.format("Hypothesis: %s\n", result.getHypothesis());
            }
            recognizer.stopRecognition();
        }
    }
    
    /home/matthew/Software/Java/Projects/Sphinx/First : [708]
    
    javac TranscriberDemo.java
    TranscriberDemo.java:7: error: package edu.cmu.sphinx.api does not exist
    import edu.cmu.sphinx.api.Configuration;
                             ^
    TranscriberDemo.java:8: error: package edu.cmu.sphinx.api does not exist
    import edu.cmu.sphinx.api.SpeechResult;
                             ^
    TranscriberDemo.java:9: error: package edu.cmu.sphinx.api does not exist
    import edu.cmu.sphinx.api.StreamSpeechRecognizer;
                             ^
    TranscriberDemo.java:15: error: cannot find symbol
            Configuration configuration = new Configuration();
            ^
      symbol:   class Configuration
      location: class TranscriberDemo
    TranscriberDemo.java:15: error: cannot find symbol
            Configuration configuration = new Configuration();
                                              ^
      symbol:   class Configuration
      location: class TranscriberDemo
    TranscriberDemo.java:24: error: cannot find symbol
            StreamSpeechRecognizer recognizer = new StreamSpeechRecognizer(
            ^
      symbol:   class StreamSpeechRecognizer
      location: class TranscriberDemo
    TranscriberDemo.java:24: error: cannot find symbol
            StreamSpeechRecognizer recognizer = new StreamSpeechRecognizer(
                                                    ^
      symbol:   class StreamSpeechRecognizer
      location: class TranscriberDemo
    TranscriberDemo.java:29: error: cannot find symbol
            SpeechResult result;
            ^
      symbol:   class SpeechResult
      location: class TranscriberDemo
    8 errors
    
    /home/matthew/Software/Java/Projects/Sphinx/First : [709]
    

    Again, TIA

     

    Last edit: Nickolay V. Shmyrev 2015-12-23
    • Nickolay V. Shmyrev

      Dear Matt

      When you compile java applications with external libraries, you need to specify them in the classpath option, so the compiler would be able to find them. It should look like this:

      javac -cp sphinx4-core.jar:sphinx4-data.jar com/example/Transcriber.java
      java -cp sphinx4-core.jar:sphinx4-data.jar com/example/Transcriber
      

      Please note that since your source uses package com.example, your file must be placed in com/example folder, not in the current folder.

      I recommend you to use IDE and also study some java basics. You can find some information here:

      http://heather.cs.ucdavis.edu/~matloff/Java/JavaIntro.html

       

      Last edit: Nickolay V. Shmyrev 2015-12-23

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.