|
|||||||||
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.WavWriter
public class WavWriter
Stores audio data into numbered (MS-)wav files.
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_CAPTURE_UTTERANCES
The SphinxProperty specifying whether the input data is signed. |
static java.lang.String |
PROP_IS_COMPLETE_PATH
|
static java.lang.String |
PROP_OUT_FILE_NAME_PATTERN
The pathname which must obey the pattern: pattern + i + .wav. |
static java.lang.String |
PROP_SIGNED_DATA
The SphinxProperty specifying whether the input data is signed. |
Constructor Summary | |
---|---|
WavWriter()
|
Method Summary | |
---|---|
static javax.sound.sampled.AudioInputStream |
convertDoublesToAudioStream(double[] values,
int sampleRate)
|
Data |
getData()
Returns the processed Data output. |
void |
initialize()
Initializes this DataProcessor. |
void |
newProperties(PropertySheet ps)
This method is called when this configurable component needs to be reconfigured. |
static byte[] |
valuesToBytes(double[] values,
int bytesPerValue,
boolean signedData)
Converts a big-endian byte array into an array of doubles. |
static void |
writeWavFile(double[] signal,
int sampleRate,
java.io.File targetFile)
Writes a given double array into a wav file (given the sample rate of the signal). |
Methods inherited from class edu.cmu.sphinx.frontend.BaseDataProcessor |
---|
getPredecessor, getTimer, setPredecessor, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
@S4String public static final java.lang.String PROP_OUT_FILE_NAME_PATTERN
@S4Boolean(defaultValue=false) public static final java.lang.String PROP_IS_COMPLETE_PATH
@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
@S4Boolean(defaultValue=false) public static final java.lang.String PROP_CAPTURE_UTTERANCES
Constructor Detail |
---|
public WavWriter()
Method Detail |
---|
public Data getData() throws DataProcessingException
BaseDataProcessor
getData
in interface DataProcessor
getData
in class BaseDataProcessor
DataProcessingException
- if a data processor error occurspublic void initialize()
initialize
in interface DataProcessor
initialize
in class BaseDataProcessor
public void newProperties(PropertySheet ps) throws PropertyException
Configurable
newProperties
in interface Configurable
newProperties
in class BaseDataProcessor
ps
- a property sheet holding the new data
PropertyException
- if there is a problem with the properties.public static byte[] valuesToBytes(double[] values, int bytesPerValue, boolean signedData) throws java.lang.ArrayIndexOutOfBoundsException
bytesPerValue
- the number of bytes per valuesignedData
- whether the data is signed
null
if byteArray is of zero length
java.lang.ArrayIndexOutOfBoundsException
public static javax.sound.sampled.AudioInputStream convertDoublesToAudioStream(double[] values, int sampleRate)
public static void writeWavFile(double[] signal, int sampleRate, java.io.File targetFile)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |