Skip to content


Android PocketSphinx, custom dictionaries

This post also requires Linux, and that you have followed steps here: http://ucla.jamesyxu.com/?p=118

  1. Create a text file, with one phrase per line
  2. Build a dict using http://www.speech.cs.cmu.edu/tools/lmtool-new.html
  3. Download the dict and lm file.
  4. Covert the lm file into a dmp by using the console command (you need to have compiled the tools first) sphinx_lm_convert -i file.lm -o file.dmp (where file is the file you downloaded)
  5. Upload these onto the android emulator/device, and update the code accordingly to load the correct files

If sphinx_lm_convert complains about library not found etc, use ldd and strace to track down which library. The sphinx libraries gets installed to /user/local/lib so you may need to export LD_LIBRARY_PATH=/usr/local/lib

If you need to create a more complex model, refer to http://cmusphinx.sourceforge.net/wiki/tutoriallm

Posted in Technology. Tagged with .