Here’s the same video tutorial but with higher video quality. For more info about the tutorial, please check the original post here.

Download Sphinx 4.0 Video Tutorial

File Details :

Name : Sphinx-Tutorial.avi

Size : 334 MBs

Duration : 26:14 Minutes

Dimensions : 1280 x 800

97 Responses

  1. I understand that the components provided for decoding will be:

    1. The decoder source code

    2. The language dictionary

    3. The filler dictionary

    4. The language model

    5. The test data

    Now, for decoding sphinx4 forms a trellis, which is noting but a prduct of language HMM and time. This trellis is noting but a acyclic graph(or a search graph as one might call it). What I am interested is in reducing the size of this structure(search graph), so as to increase the recognition capability of the system. What I am doing now is, I am passing the decoder updated language model(read grammar file). I would like to verify whether passing a smaller grammar file(pruned grammar file which suffices the need of the concerned sample to be decoded) will help reduce the size of the search graph.

    Please make suggestion or respond if I am not making myself not clear.

    I am looking forward towards this discussion.

  2. Hey, I went through your tutorial, and am getting an error…

    Exception in thread “main” Property exception component:’dictionary’ property:’fillerPath’ – Can’t locate resource:/WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz/dict/fillerdict

    edu.cmu.sphinx.util.props.InternalConfigurationException: Can’t locate resource:/WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz/dict/fillerdict

    Any ideas what I might have done wrong? Pretty sure I did everything you said to in the tutorial…

  3. Hey Guys,

    @Abey, Sphinx will work as a module on Server side and JApplet as client side on your website.

    @mtmartin, I guess you have downloaded unstable version of Acoustic model, download stable one and try with that one.

    Hope that works !

  4. Thank you so much for this tutorial! It was great! Very easy to follow and I got the HelloWorld working fine. I’m doing a learning game for Swedish children, so I’m going to check out your post about expanding the dictionary to get the 100 or so Swedish words I need my program to recognize and I hope it will work. If I understand correctly, this is possible although the words are not English? I have searched a little but not found any aucustic model for Swedish.

  5. Hello Sara,

    Yes, it is possible. But there will be some difference in pronunciation and you might have to play little with phonemes in dict file.

    Best of luck!

    ~Puneet Kalra

  6. @the heeloword.java

    symbol : constructor ConfigurationManager(java.lang.String)

    location: class edu.cmu.sphinx.util.props.ConfigurationManager

    …cm = new ConfigurationManager(args[0]);//edu.cmu.sphinx.sample.MyComponent

    1 error

  7. Thank You Puneet Bhai for the tutorial

    it was great.

    i am Working on Speech Enabled Search engine.

    Can you help me because i just starting my work. this is my final year project i’ll be thankful to you.

  8. Hello Shumaila,

    Thanks for commenting, and yea, please feel free to post here if you get stuck anywhere.

    Or you can also post on my Facebook page, Me or any other person will respond you.


    Puneet Kalra

  9. Hi there, Please could you help me iv been trying to download your tutorial about 3 – 4 times now and every time i download it it gets stuck on 121MB i need to despriately make a speech recognition but i am so new to sphinx and eclipse…

  10. Hi Puneet.. please could you tell me what iv done wrong i have followed your tutorial step by step and when i want to run the HelloWorld Demo i get the following error “main” java.lang.NoSuchFieldError: engineListeners

    when iopen the HellowWorld and check the main(String[]) it says the Jar file has no source added to it what does it mean. please help

  11. Hi Puneet,

    Is it possible to edit HellonGram demo’s dictionary and only use your own words? Please could you get back to me thank you. I’ve looked at extending the Dictionary but i actually need to create my own and am not sure how to go about that, Thank you so much and a AWESOME WEBSITE WELL DONE 🙂

    1. Hey Lauren,

      Use same Expanding Dictionary tutorial, but there will be one change, Replace your own words DIC file with original DIC file in acoustic model instead of copying your own words DIC file’s content into original DIC file.

      Or if your words going to be in thousands, you will need to work on Sphinxtrain.


      1. Hi Puneet,

        Thank you soooo much for replying 🙂

        by the way i got the dictionary working its about 300 words. but i am having a huge problem. i want it to not try force match words that are not in the dictionary to the words in my dictionary if that makes sense. let me make an example “That is a blue car” ==> words in dictionary “That is a … car”

        ==> words NOT in dictionary “blue”

        so basically i want it to display you said: “that is a car” replaces words that are not in the dictionary with “unknown” .. have you created a video demo on this ? iv been battling for a month with this “out-of-grammar” i just dont know how to actually set it up there is no proper guidance. and im just getting it wrong over and over 🙁

        Please could you give me advice i really would appreciate it so much 🙂 if you can email me please do.

        Thank you for all your hard work, your website has helped me out so much 🙂

      1. Hi, how do you go about using pocketsphinx i loaded it in Visual Studio 2010 C++ built sphinxbase and pocketsphinx have the dll’s in the bin folder but how do i actually use it in a C# application would i have to create a consol application or a winform?? please help i really need advise.

        thank so much Lauren

  12. thanks puneet

    i have integrate sphinx with web using applet. I have develop a sphinx application which runs in client machine and recognized text will post on the web page using applet.

    I have seen that google translate page (pls use chrome :http://translate.google.com/?sl=en# ) and it is too good. Can u suggest how I can make web page like this using sphinx?

  13. Hey Abey,

    There are many ways of doing that. First step will be same for all and that will be recognising speech through Sphinx, which is integrated by applet.

    Second step will be sending recognised string plus translation details to server through networking, Or you can use Google Translate API but unfortunately that will be taken down by Dec 2011, so you might need to find another one.

    Third step will be getting output from Applet or from Server using Ajax depending on what you choose on second step.

    That’s the basic idea how it will work but there are many important aspects to consider before you make the final go.

    Best of luck, ~Puneet

  14. Hi!

    Sphinx4 related topic

    When i running regression test its gives following error.

    [java] java.lang.NoClassDefFoundError: edu/cmu/sphinx/util/props/Configurable

    can you tell me which jar file contain above class definition ??


  15. Hi Puneetk,

    Do you know how to make your hellongram demo to only pick up the words in your dictionary and not try force match words that are not in the dictionary to words that are in the dictionary, Hope that makes sense. so it looks at the Out of Grammar fact. so for example i would like it to display “that is a car”

    what was said: “that is a ugly car”..

    Please could you help me thank you sooo much 😀

    1. hi again i got the sphinx4 working lovely unfortunately i have to have the speech recognition in my C# project. so i really need some help please please please.. iv been battling for 3 months now trying to just get even a demo running in C++ please can anyone help me :'( please

  16. Mr.Punit, great work on this forum and thank you very much for your video tut. I think you are the best guy on earth to solve my problem.

    I copied the /demo/sphinx/HelloWorld source folder and pasted in netbeans’ project src folder.The folder has all the needed gram,xml and java files.But as I tried to run it following error comes:

    Problem configuring HelloWorld: Property Exception component:’jsgfGrammar’ property:’grammarLocation’ – Can’t locate resource:/helloworld.HelloWorld

    Property Exception component:’jsgfGrammar’ property:’grammarLocation’ – Can’t locate resource:/helloworld.HelloWorld

    at edu.cmu.sphinx.util.props.ValidatingPropertySheet.getResource(ValidatingPropertySheet.java:372)

    at edu.cmu.sphinx.jsapi.JSGFGrammar.newProperties(JSGFGrammar.java:272)

    at edu.cmu.sphinx.util.props.ConfigurationManager.lookup(ConfigurationManager.java:214)

    at edu.cmu.sphinx.util.props.ValidatingPropertySheet.getComponent(ValidatingPropertySheet.java:403)

    at edu.cmu.sphinx.linguist.flat.FlatLinguist.newProperties(FlatLinguist.java:248)

    at edu.cmu.sphinx.util.props.ConfigurationManager.lookup(ConfigurationManager.java:214)

    at edu.cmu.sphinx.util.props.ValidatingPropertySheet.getComponent(ValidatingPropertySheet.java:403)

    at edu.cmu.sphinx.decoder.search.SimpleBreadthFirstSearchManager.newProperties(SimpleBreadthFirstSearchManager.java:180)

    at edu.cmu.sphinx.util.props.ConfigurationManager.lookup(ConfigurationManager.java:214)

    at edu.cmu.sphinx.util.props.ValidatingPropertySheet.getComponent(ValidatingPropertySheet.java:403)

    at edu.cmu.sphinx.decoder.Decoder.newProperties(Decoder.java:71)

    at edu.cmu.sphinx.util.props.ConfigurationManager.lookup(ConfigurationManager.java:214)

    at edu.cmu.sphinx.util.props.ValidatingPropertySheet.getComponent(ValidatingPropertySheet.java:403)

    at edu.cmu.sphinx.recognizer.Recognizer.newProperties(Recognizer.java:93)

    at edu.cmu.sphinx.util.props.ConfigurationManager.lookup(ConfigurationManager.java:214)

    at helloworld.HelloWorld.main(HelloWorld.java:49)

    I also changed the hellworld.config.xml file’s grammarLocation property to hold the proper package name. But problem persists.

    Any help????????????????

  17. Hello friends!!!

    I am new one with sphinx (speech recognizer). And I want to understand all about sphinx… Can you help me???

    HelloWorld.java class is not running????

  18. hi puneet. it was a great tutorial. my helloworld program works fine. but now i want to make a complete application to recognize common English words. i dont know how to make changes to config file. there are a lot of properties. plz help me. what should i do.

  19. hii,

    i’m trying to execute the sample program of sphinx but i get the following error

    Exception in thread “main” java.lang.NoSuchFieldError: engineListeners

    at com.sun.speech.engine.recognition.BaseRecognizer.fireRecognizerSuspended(BaseRecognizer.java:922)

    at com.sun.speech.engine.recognition.BaseRecognizer.dispatchSpeechEvent(BaseRecognizer.java:1262)

    at com.sun.speech.engine.SpeechEventUtilities.postSpeechEvent(SpeechEventUtilities.java:201)

    at com.sun.speech.engine.SpeechEventUtilities.postSpeechEvent(SpeechEventUtilities.java:132)

    at com.sun.speech.engine.recognition.BaseRecognizer.postRecognizerSuspen


    at com.sun.speech.engine.recognition.BaseRecognizer.commitChanges(BaseRecognizer.java:358)

    at edu.cmu.sphinx.jsapi.JSGFGrammar.commitChanges(JSGFGrammar.java:536)

    at edu.cmu.sphinx.jsapi.JSGFGrammar.createGrammar(JSGFGrammar.java:243)

    at edu.cmu.sphinx.linguist.language.grammar.Grammar.allocate(Grammar.java:101)

    at edu.cmu.sphinx.linguist.flat.FlatLinguist.allocate(FlatLinguist.java:229)

    at edu.cmu.sphinx.decoder.search.SimpleBreadthFirstSearchManager.allocat


    at edu.cmu.sphinx.decoder.AbstractDecoder.allocate(AbstractDecoder.java:


    at edu.cmu.sphinx.recognizer.Recognizer.allocate(Recognizer.java:157)

    at edu.cmu.sphinx.demo.helloworld.HelloWorld.main(HelloWorld.java:37)

  20. Hi, this tut is awesome, but the hd video to download is only first part 🙁 are you try to upload HD on megavideo? 🙂

  21. Hey Puneet, Thanks for the tutorial. I could run the hello world demo pretty smoothly.

    In your tutorial, you took a file name “edu.cmu.sphinx.demo.helloworld” form a project named “VoiceCal” which contained the source file of the demos. Could you upload the download link of the source files of the demo or the source files please ..I googled them but couldn’t found any link so far.

    One more request, would you make a video tutorial on adding words inside the dictionary and making essential changes in .gram file? It would be very helpful.

    Thanks a lot,


  22. Hi, thank you so much for the great tuto 🙂

    I did everything and it’s working great,

    my question is: I trained an acoustic model from scratch, can please tell me how to use my input files and my acoustic model with the same demo “helloworld”?!!

    I tried to open for example the xml file in eclipse but I can’t write to it…

    Please help me, I new with java.

    Thank you 🙂

  23. I am getting error like this during my execution. I allocated the resources using vm option -mx256m but its not working fine.

    Exception in thread “main” java.lang.RuntimeException: Allocation of search manager resources failed at edu.cmu.sphinx.decoder.search.SimpleBreadthFirstSearchManager.allocate(SimpleBreadthFirstSearchManager.java:650)

    at edu.cmu.sphinx.decoder.AbstractDecoder.allocate(AbstractDecoder.java:87)

    at edu.cmu.sphinx.recognizer.Recognizer.allocate(Recognizer.java:168)

    at edu.cmu.sphinx.demo.helloworld.HelloWorld.main(HelloWorld.java:37)

    Caused by: java.io.FileNotFoundException: JAR entry WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz/means not found in C:\Users\Anand Kumar\Documents\NetBeansProjects\sphinx\sphinx4-1.0beta6-src\sphinx4-1.0beta6\src\jsapi2\org.jvoicexml.jsapi2.jse.sphinx4\3rdparty\sphinx4\lib\WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz.jar

    at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:122)

    at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:132)

    at java.net.URL.openStream(URL.java:1009)

    at edu.cmu.sphinx.linguist.acoustic.tiedstate.Sphinx3Loader.getDataStream(Sphinx3Loader.java:260)

    at edu.cmu.sphinx.linguist.acoustic.tiedstate.Sphinx3Loader.readS3BinaryHeader(Sphinx3Loader.java:514)

    at edu.cmu.sphinx.linguist.acoustic.tiedstate.Sphinx3Loader.loadDensityFile(Sphinx3Loader.java:443)

    at edu.cmu.sphinx.linguist.acoustic.tiedstate.Sphinx3Loader.loadModelFiles(Sphinx3Loader.java:332)

    at edu.cmu.sphinx.linguist.acoustic.tiedstate.Sphinx3Loader.load(Sphinx3Loader.java:280)

    at edu.cmu.sphinx.linguist.acoustic.tiedstate.TiedStateAcousticModel.allocate(TiedStateAcousticModel.java:116)

    at edu.cmu.sphinx.linguist.flat.FlatLinguist.allocateAcousticModel(FlatLinguist.java:314)

    at edu.cmu.sphinx.linguist.flat.FlatLinguist.allocate(FlatLinguist.java:299)

    at edu.cmu.sphinx.decoder.search.SimpleBreadthFirstSearchManager.allocate(SimpleBreadthFirstSearchManager.java:646)

    … 3 more

  24. Hey Puneet,

    i have tried with all the sampled code provided by Sphinx 4.0 but unfortunately i could not even make even a single program to understand what i am saying … i am using good quality of mic but still it did not maches with the text.

    for example :-
    in helloworld program if i say hello will it chose any random name from the grammar file
    can you please help me if you have ever faced such issue.

    Thanks in advance!!

  25. help me solve the error

    following is my code:

    import java.io.File;

    import java.net.URL;

    import edu.cmu.sphinx.api.Configuration;

    import edu.cmu.sphinx.api.LiveSpeechRecognizer;

    import edu.cmu.sphinx.api.SpeechResult;

    import edu.cmu.sphinx.api.StreamSpeechRecognizer;

    import edu.cmu.sphinx.demo.transcriber.Transcriber;

    import edu.cmu.sphinx.frontend.util.AudioFileDataSource;

    import edu.cmu.sphinx.recognizer.Recognizer;

    import edu.cmu.sphinx.result.Result;

    import edu.cmu.sphinx.util.props.ConfigurationManager;

    import edu.cmu.sphinx.frontend.util.AudioFileDataSource;

    import edu.cmu.sphinx.recognizer.Recognizer;

    import edu.cmu.sphinx.result.Result;

    import javax.sound.sampled.UnsupportedAudioFileException;

    import java.io.File;

    import java.io.IOException;

    import java.net.URL;

    import java.util.ArrayList;

    import java.util.List;

    public class Example {

    public static List unitTestBuffer = new ArrayList();

    private static final String ACOUSTIC_MODEL =


    private static final String DICTIONARY_PATH =


    private static final String LANGUAGE_MODEL =


    public static void main(String[] args) throws Exception {

    Configuration configuration = new Configuration();




    URL audioURL;

    if (args.length > 0) {

    audioURL = new File(args[0]).toURI().toURL();

    } else {

    audioURL = Transcriber.class.getResource(“satya.wav”);


    URL configURL = Transcriber.class.getResource(“config.xml”);

    ConfigurationManager cm = new ConfigurationManager(configURL);

    Recognizer recognizer = (Recognizer) cm.lookup(“recognizer”);

    /* allocate the resource necessary for the recognizer */


    // configure the audio input for the recognizer

    AudioFileDataSource dataSource = (AudioFileDataSource) cm.lookup(“audioFileDataSource”);

    dataSource.setAudioFile(audioURL, null);

    // Loop unitl last utterance in the audio file has been decoded, in which case the recognizer will return null.

    Result result;

    while ((result = recognizer.recognize())!= null) {

    String resultText = result.getBestResultNoFiller();






    i got the following error:

    Exception in thread “main” java.lang.NullPointerException

    at com.sun.media.sound.StandardMidiFileReader.getSequence(Unknown Source)

    at javax.sound.midi.MidiSystem.getSequence(Unknown Source)

    at com.sun.media.sound.SoftMidiAudioFileReader.getAudioInputStream(Unknown Source)

    at javax.sound.sampled.AudioSystem.getAudioInputStream(Unknown Source)

    at edu.cmu.sphinx.frontend.util.AudioFileDataSource.setAudioFile(AudioFileDataSource.java:150)

    at Example.main(Example.java:65)

  26. Hello Puneet,

    Very good your tutorial, I’m working with sphinx too.

    I used SphinxTrain to create my own model which is in Portuguese.

    Now I want to use this model created in sphinx4 with eclipse, could you help me?

  27. Is there a Turkish library? And the performance is pretty bad. Does anyone know a better work performance point of that?

  28. Hello Puneet, As I am getting problem with how to use the sphinx4-5prealpha version. Since, i hear that it has improve in accuracy. But, i don’t know how to use it as i not found any sphinx4-5prealpha-bin for it. Would you might make one more vedio on that.
    Thanks in Advance!!!

Leave a Reply

Your email address will not be published. Required fields are marked *

Notice: Use of undefined constant STOPSPAM_PLUGIN_VERSION - assumed 'STOPSPAM_PLUGIN_VERSION' in /home/webpilla/puneetk.com/wp-content/plugins/stop-spam/stop-spam.php on line 36

Notice: Use of undefined constant STOPSPAM_PLUGIN_VERSION - assumed 'STOPSPAM_PLUGIN_VERSION' in /home/webpilla/puneetk.com/wp-content/plugins/stop-spam/stop-spam.php on line 40