You are here

Sphinx Addon for Processing

see this page http://wiki.roberttwomey.com/UNTREF_Speech_Workshop#Hands-on_with_Sphinx4_Library_for_Processing

This page includes a wrapper of the CMU Sphinx library for Processing. Read more about the CMU Sphinx project athttp://cmusphinx.sourceforge.net/

Library

- JAR file and some necessary language and acoustic models to do Sphinx-based speech recognition. Download the zip file below and copy it to your Processing/libraries folder: sphinx.zip

Processing Example 1 - Grammar-Based Recognition

- simple grammar-based speech recognition: sphinxGrammarCustomdict.zip
- this example uses a simple grammar. In the data folder it has a grammar file (.gram), a dictionary file (.dict), and a config file (.xml)
- the grammar file (upstairs.gram) is a JSGF format grammar file that lists the possible words your system can hear. It has a format with individual words in upper-case letters, and a "|" mark between each word. You should be able to edit this file and fill it with your own words.
- the dict file (upstairs.dict) is a pronunciation dictionary file. It breaks each of those upper-case words from the grammar into phonemic units. The easiest way to make a new dictionary with your own words is to use the online language tool described below.
- finally, the config file (upstairs.config.xml) specifies various parameters and file-names for the speech recognition engine. In this file you will probably need to change the path to your data files such as the grammar, dict, and the Library files you installed above. If you edit the xml file you will see that a lot of the paths are of the form "/Users/rtwomey/" which is obviously my computer, replace with the path to the file on your system. contact me if this doesn't work

Processing Example 2 - SLM-Based Recognition

- This example does Sphinx4 automatic speech recognition using a statistical language model (SLM) rather than a grammar.
- As above, you may need to change some file paths in the sphinx_config.xml file to match the setup on your system.
- I have included two SLMs in the data directory, 3990.lm/3990.dict, and 7707.lm/7707.dict
- The SLMs were generated with the CMU Sphinx Knowledge Base Tool (see below).

Online Tool for Training Language Models

- this produces a statistical language model and dictionary (along with various other products) for any text file you upload:http://www.speech.cs.cmu.edu/tools/lmtool-new.html
- your text file should have one sentence per line.
- upload it and then click "Compile Knowledge Base."
- on the results screen, click on the .TAR file to download it. Unzip this, and take the .dic file. This is your pronunciation dictionary. You may want to rename it to .dict to match the files in the sketch. Or change your config file.
- The processing example code above runs from a grammar (.gram) and a dictionary (.dict). This online language tools generates the dictionary for your text but not the grammar. You will need to make the grammar on your own.