|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbe.hogent.tarsos.sampled.AudioDispatcher
public final class AudioDispatcher
Constructor Summary | |
---|---|
AudioDispatcher(javax.sound.sampled.AudioInputStream stream,
int audioBufferSize,
int bufferOverlap)
Create a new. |
Method Summary | |
---|---|
void |
addAudioProcessor(AudioProcessor audioProcessor)
Adds an AudioProcessor to the list of subscribers. |
static AudioDispatcher |
fromByteArray(byte[] byteArray,
javax.sound.sampled.AudioFormat audioFormat,
int audioBufferSize,
int bufferOverlap)
Create a stream from an array of bytes and use that to create a new audioprocessor. |
static AudioDispatcher |
fromFile(java.io.File audioFile,
int size)
Create a stream from a file and use that to create a new audioprocessor. |
void |
run()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AudioDispatcher(javax.sound.sampled.AudioInputStream stream, int audioBufferSize, int bufferOverlap) throws javax.sound.sampled.UnsupportedAudioFileException
stream
- The stream to read data from.audioBufferSize
- The size of the buffer defines how much samples are processed
in one step. Common values are 1024,2048.bufferOverlap
- How much consecutive buffers overlap (in samples). Half of the
AudioBufferSize is common.
javax.sound.sampled.UnsupportedAudioFileException
- If an unsupported format is used.Method Detail |
---|
public void addAudioProcessor(AudioProcessor audioProcessor)
audioProcessor
- The AudioProcessor to add.public void run()
run
in interface java.lang.Runnable
public static AudioDispatcher fromFile(java.io.File audioFile, int size) throws javax.sound.sampled.UnsupportedAudioFileException, java.io.IOException
audioFile
- The file.size
- The number of samples used in the buffer.
javax.sound.sampled.UnsupportedAudioFileException
- If the audio file is not supported.
java.io.IOException
- When an error occurs reading the file.public static AudioDispatcher fromByteArray(byte[] byteArray, javax.sound.sampled.AudioFormat audioFormat, int audioBufferSize, int bufferOverlap) throws javax.sound.sampled.UnsupportedAudioFileException
byteArray
- An array of bytes, containing audio information.audioFormat
- The format of the audio represented using the bytes.audioBufferSize
- The size of the buffer defines how much samples are processed
in one step. Common values are 1024,2048.bufferOverlap
- How much consecutive buffers overlap (in samples). Half of the
AudioBufferSize is common.
javax.sound.sampled.UnsupportedAudioFileException
- If the audio format is not supported.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |