|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object be.hogent.tarsos.dsp.WaveformWriter
public class WaveformWriter
Writes a WAV-file to disk. It stores the bytes to a raw file and when the processingFinished method is called it prepends the raw file with a header to make it a legal WAV-file.
Writing a RAW file first and then a header is needed because the header contains fields for the size of the file, which is unknown beforehand. See Subchunk2Size and ChunkSize on this wav file reference.
Constructor Summary | |
---|---|
WaveformWriter(javax.sound.sampled.AudioFormat format,
java.lang.String fileName)
Initialize the writer. |
Method Summary | |
---|---|
boolean |
process(AudioEvent audioEvent)
Process the audio event. |
void |
processingFinished()
Notify the AudioProcessor that no more data is available and processing has finished. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WaveformWriter(javax.sound.sampled.AudioFormat format, java.lang.String fileName)
format
- The format of the received bytes.fileName
- The name of the wav file to store.Method Detail |
---|
public boolean process(AudioEvent audioEvent)
AudioProcessor
process
in interface AudioProcessor
audioEvent
- The audio event that contains audio data.
public void processingFinished()
AudioProcessor
processingFinished
in interface AudioProcessor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |