com.aurellem.capture.audio
Class WaveFileWriter
java.lang.Object
com.aurellem.capture.audio.WaveFileWriter
- All Implemented Interfaces:
- SoundProcessor
public class WaveFileWriter
- extends java.lang.Object
- implements SoundProcessor
A SoundProcessor that sends all sound data it receives to a wav file.
- Author:
- Robert McIntyre
Method Summary |
void |
cleanup()
Called when the SoundProcessor is being destroyed, and
there are no more samples to process. |
void |
init(javax.sound.sampled.AudioFormat format)
|
void |
process(java.nio.ByteBuffer audioSamples,
int numSamples,
javax.sound.sampled.AudioFormat format)
Called whenever there are new audio samples to process. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
targetFile
public java.io.File targetFile
WaveFileWriter
public WaveFileWriter(java.io.File targetFile)
throws java.io.FileNotFoundException
- Throws:
java.io.FileNotFoundException
init
public void init(javax.sound.sampled.AudioFormat format)
process
public void process(java.nio.ByteBuffer audioSamples,
int numSamples,
javax.sound.sampled.AudioFormat format)
- Description copied from interface:
SoundProcessor
- Called whenever there are new audio samples to process. The
audioSamples ByteBuffer contains 3D audio data rendered by
OpenAL.
- Specified by:
process
in interface SoundProcessor
- Parameters:
audioSamples
- a ByteBuffer containing processed audio
samplesnumSamples
- the number of samples, in bytes, that are validformat
- the format of the audio samples in audioSamples
cleanup
public void cleanup()
- Description copied from interface:
SoundProcessor
- Called when the SoundProcessor is being destroyed, and
there are no more samples to process. This happens at the
latest when the Application is shutting down.
- Specified by:
cleanup
in interface SoundProcessor