|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectddf.minim.SignalSplitter
public class SignalSplitter
A SignalSplitter acts exactly like a headphone splitter.
When you pass it audio with the samples method, it echoes that
audio out to all of its listeners, giving each their own copy of the audio.
In other words, changes that the listeners make to the float arrays
they receive from a SignalSplitter will not be reflected in
the arrays you pass to samples. SignalSplitter is
fully synchronized so that listeners cannot be added and
removed while it is in the midst transmitting.
| Constructor Summary | |
|---|---|
SignalSplitter(javax.sound.sampled.AudioFormat format,
int bufferSize)
Construct a SignalSplitter that will receive
audio in the given format and in buffers the size of
bufferSize. |
|
| Method Summary | |
|---|---|
void |
addListener(AudioListener listener)
Adds a listener who will be notified each time this receives or creates a new buffer of samples. |
int |
bufferSize()
Returns the buffer size being used by this. |
javax.sound.sampled.AudioFormat |
getFormat()
Returns the format of this recordable audio. |
void |
removeListener(AudioListener listener)
Removes the listener from the list of listeners. |
float |
sampleRate()
Returns the sample rate of this recordable audio. |
void |
samples(float[] samp)
Called by the Recordable object this is attached to
when that object has new samples. |
void |
samples(float[] sampL,
float[] sampR)
Called by the Recordable object this is attached to
when that object has new samples. |
int |
type()
Returns either Minim.MONO or Minim.STEREO |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SignalSplitter(javax.sound.sampled.AudioFormat format,
int bufferSize)
SignalSplitter that will receive
audio in the given format and in buffers the size of
bufferSize. Strictly speaking, a SignalSplitter
doesn't care about either of these things because it does nothing with
the samples it receives other than pass them on. But both things are
required to fulfill the Recordable contract.
format - the AudioFormat of samples that this will receivebufferSize - the size of the float arrays this will receive| Method Detail |
|---|
public int bufferSize()
Recordable
bufferSize in interface Recordablepublic javax.sound.sampled.AudioFormat getFormat()
Recordable
getFormat in interface Recordablepublic int type()
Recordable
type in interface Recordablepublic void addListener(AudioListener listener)
Recordable
addListener in interface Recordablelistener - the listener to addpublic void removeListener(AudioListener listener)
Recordable
removeListener in interface Recordablelistener - the listener to removepublic void samples(float[] samp)
AudioListenerRecordable object this is attached to
when that object has new samples.
samples in interface AudioListenersamp - a buffer of samples from a MONO sound stream
public void samples(float[] sampL,
float[] sampR)
AudioListenerRecordable object this is attached to
when that object has new samples.
samples in interface AudioListenersampL - the left channel of a STEREO sound streamsampR - the right channel of a STEREO sound streampublic float sampleRate()
Recordable
sampleRate in interface Recordable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||