|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.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 boolean |
PROP_BIG_ENDIAN_DATA_DEFAULT
The default value for PROP_IS_DATA_BIG_ENDIAN. |
static java.lang.String |
PROP_BITS_PER_SAMPLE
SphinxProperty for the number of bits per value. |
static int |
PROP_BITS_PER_SAMPLE_DEFAULT
Default value for PROP_BITS_PER_SAMPLE. |
static java.lang.String |
PROP_BYTES_PER_READ
SphinxProperty for the number of bytes to read from the InputStream each time. |
static int |
PROP_BYTES_PER_READ_DEFAULT
Default value for PROP_BYTES_PER_READ. |
static java.lang.String |
PROP_SAMPLE_RATE
SphinxProperty for the sample rate. |
static int |
PROP_SAMPLE_RATE_DEFAULT
Default value for PROP_SAMPLE_RATE. |
static java.lang.String |
PROP_SIGNED_DATA
The SphinxProperty specifying whether the input data is signed. |
static boolean |
PROP_SIGNED_DATA_DEFAULT
The default value of PROP_SIGNED_DATA. |
| Constructor Summary | |
|---|---|
StreamDataSource()
|
|
| 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 |
|---|
getName, getPredecessor, getTimer, setPredecessor, 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
public static final int PROP_SAMPLE_RATE_DEFAULT
@S4Integer(defaultValue=3200) public static final java.lang.String PROP_BYTES_PER_READ
public static final int PROP_BYTES_PER_READ_DEFAULT
@S4Integer(defaultValue=16) public static final java.lang.String PROP_BITS_PER_SAMPLE
public static final int PROP_BITS_PER_SAMPLE_DEFAULT
@S4Boolean(defaultValue=true) public static final java.lang.String PROP_BIG_ENDIAN_DATA
public static final boolean PROP_BIG_ENDIAN_DATA_DEFAULT
@S4Boolean(defaultValue=true) public static final java.lang.String PROP_SIGNED_DATA
public static final boolean PROP_SIGNED_DATA_DEFAULT
| Constructor Detail |
|---|
public StreamDataSource()
| Method Detail |
|---|
public void newProperties(PropertySheet ps)
throws PropertyException
Configurable
newProperties in interface ConfigurablenewProperties in class BaseDataProcessorps - 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 | ||||||||