Depending on available system resources, it may be possible to run an instance of this class and an instance of SoundCapture concurrently. This allows for the concurrent capture, signal processing, and playback of audio data.
After calling the appropriate constructor, startPlayback() must be called to initialize the audio system. The putSamples() or putSamplesInt() method should then be repeatedly called to deliver the audio data to the audio output device (speaker or file). The audio samples delivered to putSamples() should be in the proper range, or clipping will occur. putSamples() expects the samples to be in the range (-1, 1). putSamplesInt() expects the samples to be in the range (-2^(bits_per_sample/2), 2^(bits_per_sample/2)), where bits_per_sample is the number of bits per sample. Note that it is possible (but probably not useful) to interleave calls to putSamples() and putSamplesInt(). Finally, after no more audio playback is desired, stopPlayback() should be called to free up audio system resources.
Note: Requires Java 2 v1.3.0 or later. @author Brian K. Vogel @version $Id: SoundPlayback.java,v 1.60 2007/12/06 18:30:03 cxh Exp $ @since Ptolemy II 1.0 @Pt.ProposedRating Yellow (vogel) @Pt.AcceptedRating Yellow (cxh) @see ptolemy.media.javasound.SoundCapture
|
|