|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.cmu.sphinx.util.props.ConfigurableAdapter
edu.cmu.sphinx.frontend.BaseDataProcessor
edu.cmu.sphinx.frontend.util.StreamDataSource
public class StreamDataSource
A StreamDataSource converts data from an InputStream into Data objects. One would call setInputStreamto set the input stream, and call getData()to obtain the
Data object.
| Field Summary | |
|---|---|
static java.lang.String |
PROP_BIG_ENDIAN_DATA
The SphinxProperty specifying whether the input data is big-endian. |
static java.lang.String |
PROP_BITS_PER_SAMPLE
SphinxProperty for the number of bits per value. |
static java.lang.String |
PROP_BYTES_PER_READ
SphinxProperty for the number of bytes to read from the InputStream each time. |
static java.lang.String |
PROP_SAMPLE_RATE
SphinxProperty for the sample rate. |
static java.lang.String |
PROP_SIGNED_DATA
The SphinxProperty specifying whether the input data is signed. |
| Constructor Summary | |
|---|---|
StreamDataSource()
|
|
StreamDataSource(int sampleRate,
int bytesPerRead,
int bitsPerSample,
boolean bigEndian,
boolean signedData)
|
|
| Method Summary | |
|---|---|
Data |
getData()
Reads and returns the next Data from the InputStream of StreamDataSource, return null if no data is read and end of file is reached. |
void |
initialize()
Initializes this DataProcessor. |
void |
newProperties(PropertySheet ps)
This method is called when this configurable component needs to be reconfigured. |
void |
setInputStream(java.io.InputStream inputStream,
java.lang.String streamName)
Sets the InputStream from which this StreamDataSource reads. |
| 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 |
|---|
@S4Integer(defaultValue=16000) public static final java.lang.String PROP_SAMPLE_RATE
@S4Integer(defaultValue=3200) public static final java.lang.String PROP_BYTES_PER_READ
@S4Integer(defaultValue=16) public static final java.lang.String PROP_BITS_PER_SAMPLE
@S4Boolean(defaultValue=true) public static final java.lang.String PROP_BIG_ENDIAN_DATA
@S4Boolean(defaultValue=true) public static final java.lang.String PROP_SIGNED_DATA
| Constructor Detail |
|---|
public StreamDataSource(int sampleRate,
int bytesPerRead,
int bitsPerSample,
boolean bigEndian,
boolean signedData)
public StreamDataSource()
| Method Detail |
|---|
public void newProperties(PropertySheet ps)
throws PropertyException
Configurable
newProperties in interface ConfigurablenewProperties in class ConfigurableAdapterps - a property sheet holding the new data
PropertyException - if there is a problem with the properties.public void initialize()
BaseDataProcessor
initialize in interface DataProcessorinitialize in class BaseDataProcessor
public void setInputStream(java.io.InputStream inputStream,
java.lang.String streamName)
inputStream - the InputStream from which audio data comesstreamName - the name of the InputStream
public Data getData()
throws DataProcessingException
getData in interface DataProcessorgetData in class BaseDataProcessornull if none is available
DataProcessingException - if there is a data processing error
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||