The zeroth thing you need is the Pocketsphinx binaries.

The first thing you need to do is build a language model or a grammar.

The grammar can be something simple in a format called JSGF, and this is the easier way to get a speech recognizer up and running. Alternatively, you can use a language model. The language model can be built using the instructions on the Sphinx site. You can create it starting from a file with sentences like this:

<s> I WANT A NEXTCUBE ZERO FOUR ZERO </s>
<s> I WANT THE NEXTCUBE ZERO FOUR ZERO </s>
<s> I NEED A NEXTCUBE ZERO FOUR ZERO </s>
<s> I NEED THE NEXTCUBE ZERO FOUR ZERO </s>
<s> I AM LOOKING FOR A NEXTCUBE ZERO FOUR ZERO </s>
<s> I AM LOOKING FOR THE NEXTCUBE ZERO FOUR ZERO </s>
<s> I AM SEEKING A NEXTCUBE ZERO FOUR ZERO </s>
<s> I AM SEEKING THE NEXTCUBE ZERO FOUR ZERO </s>

A sample JSGF file would be (modified from the sample on the Sphinx website) … note that I’ve made all the words capitals because the CMU phonetic dictionary has all the words listed in caps (make sure that any language model is all caps as well, except for the sentence boundaries):

Education

Imagine a day when spoken language sentences can be recognized perfectly by a machine.

It suddenly becomes much easier and more natural to issue commands and pose queries in a natural language, rather than, say in XML. Imagine speaking a C program to someone, syntax and all. That would be really weird!