edu.cmu.sphinx.frontend.util
Class StreamHTKCepstrum

java.lang.Object
  extended by edu.cmu.sphinx.util.props.ConfigurableAdapter
      extended by edu.cmu.sphinx.frontend.BaseDataProcessor
          extended by edu.cmu.sphinx.frontend.util.StreamHTKCepstrum
All Implemented Interfaces:
DataProcessor, Configurable

public class StreamHTKCepstrum
extends BaseDataProcessor

Produces Mel-cepstrum data from an InputStream. To set the input stream with cepstral data, use the setInputStream method, and then call getData() to obtain the Data objects that have cepstrum data in it.


Field Summary
static java.lang.String PROP_BIGENDIAN
          The SphinxProperty specifying whether the input is big endian.
static java.lang.String PROP_BINARY
          The SphinxProperty specifying whether the input is in binary.
static java.lang.String PROP_CEPSTRUM_LENGTH
          The sphinx property specifying the length of the cepstrum data.
static java.lang.String PROP_FRAME_SHIFT_MS
          The sphinx property name for frame shift in milliseconds, which has a default value of 10F.
static java.lang.String PROP_FRAME_SIZE_MS
          The sphinx property name for frame size in milliseconds.
static java.lang.String PROP_SAMPLE_RATE
          The sphinx property that defines the sample rate
 
Constructor Summary
StreamHTKCepstrum()
           
StreamHTKCepstrum(float frameShiftMs, float frameSizeMs, boolean bigEndian, int sampleRate)
           
 
Method Summary
 Data getData()
          Returns the next Data object, which is the mel cepstrum of the input frame.
 void initialize()
          Constructs a StreamCepstrumSource that reads MelCepstrum data from the given path.
 void newProperties(PropertySheet ps)
          This method is called when this configurable component needs to be reconfigured.
static short readLittleEndianShort(java.io.DataInputStream dataStream)
           
 void setInputStream(java.io.InputStream stream)
          Sets the InputStream to read cepstral data from.
 
Methods inherited from class edu.cmu.sphinx.frontend.BaseDataProcessor
getPredecessor, getTimer, setPredecessor
 
Methods inherited from class edu.cmu.sphinx.util.props.ConfigurableAdapter
getName, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROP_BINARY

@S4Boolean(defaultValue=true)
public static final java.lang.String PROP_BINARY
The SphinxProperty specifying whether the input is in binary.

See Also:
Constant Field Values

PROP_BIGENDIAN

@S4Boolean(defaultValue=true)
public static final java.lang.String PROP_BIGENDIAN
The SphinxProperty specifying whether the input is big endian.

See Also:
Constant Field Values

PROP_FRAME_SIZE_MS

@S4Double(defaultValue=25.625)
public static final java.lang.String PROP_FRAME_SIZE_MS
The sphinx property name for frame size in milliseconds.

See Also:
Constant Field Values

PROP_FRAME_SHIFT_MS

@S4Double(defaultValue=10.0)
public static final java.lang.String PROP_FRAME_SHIFT_MS
The sphinx property name for frame shift in milliseconds, which has a default value of 10F.

See Also:
Constant Field Values

PROP_CEPSTRUM_LENGTH

@S4Integer(defaultValue=13)
public static final java.lang.String PROP_CEPSTRUM_LENGTH
The sphinx property specifying the length of the cepstrum data.

See Also:
Constant Field Values

PROP_SAMPLE_RATE

@S4Integer(defaultValue=16000)
public static final java.lang.String PROP_SAMPLE_RATE
The sphinx property that defines the sample rate

See Also:
Constant Field Values
Constructor Detail

StreamHTKCepstrum

public StreamHTKCepstrum(float frameShiftMs,
                         float frameSizeMs,
                         boolean bigEndian,
                         int sampleRate)

StreamHTKCepstrum

public StreamHTKCepstrum()
Method Detail

newProperties

public void newProperties(PropertySheet ps)
                   throws PropertyException
Description copied from interface: Configurable
This method is called when this configurable component needs to be reconfigured.

Specified by:
newProperties in interface Configurable
Overrides:
newProperties in class ConfigurableAdapter
Parameters:
ps - a property sheet holding the new data
Throws:
PropertyException - if there is a problem with the properties.

initialize

public void initialize()
Constructs a StreamCepstrumSource that reads MelCepstrum data from the given path.

Specified by:
initialize in interface DataProcessor
Overrides:
initialize in class BaseDataProcessor

setInputStream

public void setInputStream(java.io.InputStream stream)
                    throws java.io.IOException
Sets the InputStream to read cepstral data from.

Parameters:
stream - the InputStream to read cepstral data from
Throws:
java.io.IOException - if an I/O error occurs

readLittleEndianShort

public static short readLittleEndianShort(java.io.DataInputStream dataStream)
                                   throws java.io.IOException
Throws:
java.io.IOException

getData

public Data getData()
             throws DataProcessingException
Returns the next Data object, which is the mel cepstrum of the input frame. However, it can also be other Data objects like DataStartSignal.

Specified by:
getData in interface DataProcessor
Specified by:
getData in class BaseDataProcessor
Returns:
the next available Data object, returns null if no Data object is available
Throws:
DataProcessingException - if a data processing error occurs