public class WavWriter extends BaseDataProcessor
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
captureUtts |
static java.lang.String |
PROP_BITS_PER_SAMPLE
The property for the number of bits per value.
|
static java.lang.String |
PROP_CAPTURE_UTTERANCES
The property 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 property specifying whether the input data is signed.
|
logger| Constructor and Description |
|---|
WavWriter() |
WavWriter(java.lang.String dumpFilePath,
boolean isCompletePath,
int bitsPerSample,
boolean isSigned,
boolean captureUtts) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
void |
setOutFilePattern(java.lang.String outFileNamePattern)
Sets the pattern for the output file name.
|
static byte[] |
valuesToBytes(double[] values,
int bytesPerValue,
boolean signedData)
Converts a big-endian byte array into an array of doubles.
|
protected void |
writeFile(java.lang.String wavName)
Writes the current stream to disc; override this method if you want to take
additional action on file writes
|
getPredecessor, setPredecessorgetName, initLogger, toString@S4String(defaultValue="seg000000") 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_SIGNED_DATA
@S4Boolean(defaultValue=false) public static final java.lang.String PROP_CAPTURE_UTTERANCES
protected boolean captureUtts
public WavWriter(java.lang.String dumpFilePath,
boolean isCompletePath,
int bitsPerSample,
boolean isSigned,
boolean captureUtts)
public WavWriter()
public void newProperties(PropertySheet ps) throws PropertyException
ConfigurablenewProperties in interface ConfigurablenewProperties in class ConfigurableAdapterps - a property sheet holding the new dataPropertyException - if there is a problem with the properties.public Data getData() throws DataProcessingException
BaseDataProcessorgetData in interface DataProcessorgetData in class BaseDataProcessorDataProcessingException - if a data processor error occurspublic void initialize()
initialize in interface DataProcessorinitialize in class BaseDataProcessorpublic void setOutFilePattern(java.lang.String outFileNamePattern)
outFileNamePattern - file namepublic static byte[] valuesToBytes(double[] values,
int bytesPerValue,
boolean signedData)
throws java.lang.ArrayIndexOutOfBoundsException
values - source valuesbytesPerValue - the number of bytes per valuesignedData - whether the data is signednull if byteArray is of zero lengthjava.lang.ArrayIndexOutOfBoundsException - if boundary failsprotected void writeFile(java.lang.String wavName)
wavName - name of the file to be written