com.aurellem.capture.audio
Class WaveFileWriter

java.lang.Object
  extended by 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

Field Summary
 java.io.File targetFile
           
 
Constructor Summary
WaveFileWriter(java.io.File targetFile)
           
 
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
 

Field Detail

targetFile

public java.io.File targetFile
Constructor Detail

WaveFileWriter

public WaveFileWriter(java.io.File targetFile)
               throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException
Method Detail

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 samples
numSamples - the number of samples, in bytes, that are valid
format - 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