PocketSphinx&#x2F;Sphinx use three models - an acoustic model, a language model and a phonetic dictionary.
I&#x27;m no expert, but as I understand them, the acoustic model converts audio samples into phonemes(?),
the language model contains probabilities of sequences of words, and the phonetic dictionary is a mapping of words to phonemes.<p>Initially, I just used standard en-us acoustic model, US english generic language model, and its associated phonetic dictionary.
This was the baseline for judging accuracy. It was ok, but neither fast nor very accurate (likely due to my accent and speech defects).
I&#x27;d say it was about 70% accurate.<p>Simply reducing the size of the vocabulary boosts accuracy because there is that much less chance of a mistake. It also improves recognition speed.
For each of my use cases (home and desktop automation), I created a plain text file with the relevant command words.
Then used their online tool [1] to generate a language model and phonetic dictionary from it.<p>For the acoustic model, there are two approaches - &quot;adapting&quot; and &quot;training&quot;. 
Training is from scratch, while adapting adapts a standard acoustic model to better match personal accent or dialect or speech defects.<p>I found training as described [2] rather intimidating, and never tried it out. This is likely to take a lot of time (a couple of days atleast I think, based on my adaptation experience).<p>Instead I &quot;adapted&quot; the en-us acoustic model [3]. 
About an hour to come up with some grammatically correct text that included all the command words and phrases I wanted. 
Then reading it aloud while recording using Audacity. I attempted this multiple times, fiddling around with microphone volume and gain, 
trying to block ambient noise (I live in a rather noisy env), redoing it, final take. Took around 8 hours altogether with breaks.
Finally generating the adapted acoustic model. About an hour.<p>About 95% of the time it understands what I say. About 5% of the time, I have to repeat. Especially with phrases.<p>Did this on both a desktop and raspberry pi. The Pi is the one managing home automation. I&#x27;m happy with it :)<p>[1]: <a href="http:&#x2F;&#x2F;www.speech.cs.cmu.edu&#x2F;tools&#x2F;lmtool-new.html" rel="nofollow">http:&#x2F;&#x2F;www.speech.cs.cmu.edu&#x2F;tools&#x2F;lmtool-new.html</a><p>[2]: <a href="http:&#x2F;&#x2F;cmusphinx.sourceforge.net&#x2F;wiki&#x2F;tutorialam" rel="nofollow">http:&#x2F;&#x2F;cmusphinx.sourceforge.net&#x2F;wiki&#x2F;tutorialam</a><p>[3]: <a href="http:&#x2F;&#x2F;cmusphinx.sourceforge.net&#x2F;wiki&#x2F;tutorialadapt" rel="nofollow">http:&#x2F;&#x2F;cmusphinx.sourceforge.net&#x2F;wiki&#x2F;tutorialadapt</a><p>PS: Reading their documentation and searching for downloads takes more time than the actual task. They really need to improve those.