Sphinx-4 WAV File Demo

A simple Sphinx-4 application that decodes a .wav file containing connnected-digits audio data. The audio format itself should be PCM-linear, with the sample rate, bits per sample, sign and endianness as specified in the config.xml file. You can supply your own audio file to be tested. If you do not supply one, a default audio file will be used.

Building

Check if the bin directory already has the WavFile.jar file. If not, type the following in the top level directory:

ant -find demo.xml

Running

First make sure that you have JSAPI setup correctly. Then, to run the demo, type:

sphinx4> java -jar bin/WavFile.jar

You will see the following result:

Loading Recognizer...

Decoding file:/home/pkwok/cvs/cmusphinx/sphinx4/bin/WavFile.jar!/demo/sphinx/wavfile/12345.wav
WAVE (.wav) file, byte length: 92044, data format: PCM_SIGNED, 16000.0 Hz, 16 bit, mono, little-endian, audio data, frame length: 46000

RESULT: one two three four five

NOTE:

  1. Make sure that you are using JavaTM 2 SDK, Standard Edition, v1.4 or higher.
  2. If you have the source distribution, make sure that the JAR file lib/sphinx4.jar is built. If not, go to the top level directory and type: ant
  3. You can supply your own test files, but they must be digits data. Some sample test files are in this directory. Just make sure that the audio format is the same as in the config.xml file, which is 16-bit signed PCM-linear, 16kHz, little-endian. The audio file format can be any format readable by Java Sound, e.g., .wav, .au. To test your own file, supply it as an argument, e.g.:
    java -jar bin/WavFile.jar ./demo/sphinx/wavfile/65536.wav


Copyright 1999-2004 Carnegie Mellon University.
Portions Copyright 2002-2004 Sun Microsystems, Inc.
Portions Copyright 2002-2004 Mitsubishi Electric Research Laboratories.
All Rights Reserved. Usage is subject to license terms.