|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjass.generators.StreamingAudioFileBuffer
public class StreamingAudioFileBuffer
A buffer from an audio file or URL, streamed off the source. Assumes 16 bit audio format.
| Field Summary | |
|---|---|
javax.sound.sampled.AudioInputStream |
audioInputStream
|
int |
bitsPerSample
Bits per sample |
int |
bufsz
Length of buffer as floats, should be numBytes/2. |
int |
bytesPerFrame
Bytes per frame (2 for mono, 4 stereo, etc.) |
int |
nChannels
Number of channels |
long |
nFrames
# frames |
int |
numBytes
bytes |
float |
srate
Sampling rate in Hertz. |
| Constructor Summary | |
|---|---|
StreamingAudioFileBuffer(java.lang.String fn)
Construct buffer from named file. |
|
StreamingAudioFileBuffer(java.net.URL url)
Construct buffer from url. |
|
| Method Summary | |
|---|---|
void |
close()
Close stream |
protected void |
loadAudio(java.lang.String fn)
Open and read audio file properties and prepare for streaming |
protected void |
loadAudio(java.net.URL url)
Open and read audio URL properties and prepare for streaming |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public float srate
public int bytesPerFrame
public long nFrames
public int numBytes
public int bitsPerSample
public int nChannels
public int bufsz
public javax.sound.sampled.AudioInputStream audioInputStream
| Constructor Detail |
|---|
public StreamingAudioFileBuffer(java.lang.String fn)
throws UnsupportedAudioFileFormatException
fn - Audio file name.
UnsupportedAudioFileFormatException
public StreamingAudioFileBuffer(java.net.URL url)
throws UnsupportedAudioFileFormatException
url - Audiofile url.
UnsupportedAudioFileFormatException| Method Detail |
|---|
public void close()
protected void loadAudio(java.lang.String fn)
throws UnsupportedAudioFileFormatException
fn - Audio file name.
UnsupportedAudioFileFormatException
protected void loadAudio(java.net.URL url)
throws UnsupportedAudioFileFormatException
url - Audiofile url.
UnsupportedAudioFileFormatException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||