edu.cmu.sphinx.frontend.util
Class StreamCepstrumSource

java.lang.Object
  extended byedu.cmu.sphinx.frontend.BaseDataProcessor
      extended byedu.cmu.sphinx.frontend.util.StreamCepstrumSource
All Implemented Interfaces:
Configurable, DataProcessor

public class StreamCepstrumSource
extends BaseDataProcessor

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


Field Summary
static java.lang.String PROP_BINARY
          The SphinxProperty specifying whether the input is in binary.
static boolean PROP_BINARY_DEFAULT
          The default value for PROP_BINARY.
static java.lang.String PROP_CEPSTRUM_LENGTH
          The sphinx property specifying the length of the cepstrum data.
static int PROP_CEPSTRUM_LENGTH_DEFAULT
          The default value of PROP_CEPSTRUM_LENGTH.
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 float PROP_FRAME_SHIFT_MS_DEFAULT
          The default value for PROP_FRAME_SHIFT_MS.
static java.lang.String PROP_FRAME_SIZE_MS
          The sphinx property name for frame size in milliseconds.
static float PROP_FRAME_SIZE_MS_DEFAULT
          The default value for PROP_FRAME_SIZE_MS.
static java.lang.String PROP_SAMPLE_RATE
          The sphinx property that defines the sample rate
static int PROP_SAMPLE_RATE_DEFAULT
          The default value for PROP_SAMPLE_RATE
 
Constructor Summary
StreamCepstrumSource()
           
 
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 has new data.
 void register(java.lang.String name, Registry registry)
          Register my properties.
 void setInputStream(java.io.InputStream is, boolean bigEndian)
          Sets the InputStream to read cepstral data from.
 
Methods inherited from class edu.cmu.sphinx.frontend.BaseDataProcessor
getName, getPredecessor, getTimer, setPredecessor, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROP_BINARY

public static final java.lang.String PROP_BINARY
The SphinxProperty specifying whether the input is in binary.

See Also:
Constant Field Values

PROP_BINARY_DEFAULT

public static final boolean PROP_BINARY_DEFAULT
The default value for PROP_BINARY.

See Also:
Constant Field Values

PROP_FRAME_SIZE_MS

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_SIZE_MS_DEFAULT

public static final float PROP_FRAME_SIZE_MS_DEFAULT
The default value for PROP_FRAME_SIZE_MS.

See Also:
Constant Field Values

PROP_FRAME_SHIFT_MS

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_FRAME_SHIFT_MS_DEFAULT

public static final float PROP_FRAME_SHIFT_MS_DEFAULT
The default value for PROP_FRAME_SHIFT_MS.

See Also:
Constant Field Values

PROP_CEPSTRUM_LENGTH

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_CEPSTRUM_LENGTH_DEFAULT

public static final int PROP_CEPSTRUM_LENGTH_DEFAULT
The default value of PROP_CEPSTRUM_LENGTH.

See Also:
Constant Field Values

PROP_SAMPLE_RATE

public static final java.lang.String PROP_SAMPLE_RATE
The sphinx property that defines the sample rate

See Also:
Constant Field Values

PROP_SAMPLE_RATE_DEFAULT

public static final int PROP_SAMPLE_RATE_DEFAULT
The default value for PROP_SAMPLE_RATE

See Also:
Constant Field Values
Constructor Detail

StreamCepstrumSource

public StreamCepstrumSource()
Method Detail

register

public void register(java.lang.String name,
                     Registry registry)
              throws PropertyException
Description copied from interface: Configurable
Register my properties. This method is called once early in the time of the component, shortly after the component is constructed. This component should register any configuration properties that it needs to register. If this configurable extends another configurable, super.register should also be called

Specified by:
register in interface Configurable
Overrides:
register in class BaseDataProcessor
Throws:
PropertyException

newProperties

public void newProperties(PropertySheet ps)
                   throws PropertyException
Description copied from interface: Configurable
This method is called when this configurable component has new data. The component should first validate the data. If it is bad the component should return false. If the data is good, the component should record the the data internally and return true.

Specified by:
newProperties in interface Configurable
Overrides:
newProperties in class BaseDataProcessor
Throws:
PropertyException

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 is,
                           boolean bigEndian)
                    throws java.io.IOException
Sets the InputStream to read cepstral data from.

Parameters:
is - the InputStream to read cepstral data from
bigEndian - true if the InputStream data is in big-endian, false otherwise
Throws:
java.io.IOException - if an I/O error occurs

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