|
||||||||||
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
A StreamDataSource converts data from an InputStream into Data objects. One
would call setInputStream
to 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 has new data. |
void |
register(java.lang.String name,
Registry registry)
Register my properties. |
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 |
public static final java.lang.String PROP_SAMPLE_RATE
public static final int PROP_SAMPLE_RATE_DEFAULT
public static final java.lang.String PROP_BYTES_PER_READ
public static final int PROP_BYTES_PER_READ_DEFAULT
public static final java.lang.String PROP_BITS_PER_SAMPLE
public static final int PROP_BITS_PER_SAMPLE_DEFAULT
public static final java.lang.String PROP_BIG_ENDIAN_DATA
public static final boolean PROP_BIG_ENDIAN_DATA_DEFAULT
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 register(java.lang.String name, Registry registry) throws PropertyException
Configurable
register
in interface Configurable
register
in class BaseDataProcessor
PropertyException
public void newProperties(PropertySheet ps) throws PropertyException
Configurable
newProperties
in interface Configurable
newProperties
in class BaseDataProcessor
PropertyException
public void initialize()
BaseDataProcessor
initialize
in interface DataProcessor
initialize
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 InputStreampublic Data getData() throws DataProcessingException
getData
in interface DataProcessor
getData
in class BaseDataProcessor
null
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 |