com.quadrique.jbuildingblocks.core.sound
Class JbbSoundHandlerAudioInputStream
java.lang.Object
java.io.InputStream
javax.sound.sampled.AudioInputStream
com.quadrique.jbuildingblocks.core.sound.JbbSoundHandlerAudioInputStream
- All Implemented Interfaces:
- Closeable
public class JbbSoundHandlerAudioInputStream
- extends AudioInputStream
This class is a custom AudioInputStream that programmatically generates sampled sounds
The underlying implementation is based on the Java Sound APIs
- Author:
- Hervé Rivere
|
Method Summary |
int |
available()
Returns the number of bytes that can be read without blocking. |
int |
read()
|
int |
read(byte[] abData,
int nOffset,
int nLength)
|
WAVEFORM_SINE
public static final int WAVEFORM_SINE
- See Also:
- Constant Field Values
WAVEFORM_SQUARE
public static final int WAVEFORM_SQUARE
- See Also:
- Constant Field Values
WAVEFORM_TRIANGLE
public static final int WAVEFORM_TRIANGLE
- See Also:
- Constant Field Values
WAVEFORM_SAWTOOTH
public static final int WAVEFORM_SAWTOOTH
- See Also:
- Constant Field Values
JbbSoundHandlerAudioInputStream
public JbbSoundHandlerAudioInputStream(int nWaveformType,
float fSignalFrequency,
float fAmplitude,
AudioFormat audioFormat,
long lLength)
available
public int available()
- Returns the number of bytes that can be read without blocking.
Since there is no blocking possible here, we simply try to
return the number of bytes available at all. In case the
length of the stream is indefinite, we return the highest
number that can be represented in an integer. If the length
if finite, this length is returned, clipped by the maximum
that can be represented.
- Overrides:
available in class AudioInputStream
read
public int read()
throws IOException
- Overrides:
read in class AudioInputStream
- Throws:
IOException
read
public int read(byte[] abData,
int nOffset,
int nLength)
throws IOException
- Overrides:
read in class AudioInputStream
- Throws:
IOException
Copyright © 2001-2008 Quadrique Corporation. All Rights Reserved.