|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectddf.minim.Controller
ddf.minim.AudioSource
public class AudioSource
An AudioSource is a kind of wrapper around an
AudioStream. An AudioSource will add its
AudioBuffers as listeners on the stream so that you can
access the stream's samples without having to implement
AudioListener yourself. It also provides the
Effectable and Recordable interface. Because an
AudioStream must be closed when you are finished with it, you
must remember to call close() on any AudioSources
you obtain from Minim, such as AudioInputs,
AudioOutputs, and AudioPlayers.
| Field Summary | |
|---|---|
AudioBuffer |
left
The buffer containing the left channel samples. |
AudioBuffer |
mix
The buffer containing the mix of the left and right channels. |
AudioBuffer |
right
The buffer containing the right channel samples. |
| Fields inherited from class ddf.minim.Controller |
|---|
BALANCE, GAIN, MUTE, PAN, SAMPLE_RATE, VOLUME |
| Constructor Summary | |
|---|---|
AudioSource(AudioOut istream)
Constructs an AudioSource that will subscribe to the samples
in stream. |
|
| Method Summary | |
|---|---|
void |
addEffect(AudioEffect effect)
Adds an effect to the effects chain. |
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. |
void |
clearEffects()
Removes all effects from the effect chain. |
void |
close()
Closes the AudioStream this was constructed with. |
void |
disableEffect(AudioEffect effect)
Disables effect if it is in the chain. |
void |
disableEffect(int i)
disables the ith effect in the effect chain. |
int |
effectCount()
Returns the number of effects in the chain. |
void |
effects()
Enables all effects currently attached to this. |
void |
enableEffect(AudioEffect effect)
Enables effect if it is in the chain. |
void |
enableEffect(int i)
Enables the ith effect in the effect chain. |
AudioEffect |
getEffect(int i)
Returns the ith effect in the effect chain. |
javax.sound.sampled.AudioFormat |
getFormat()
Returns the format of this recordable audio. |
boolean |
hasEffect(AudioEffect e)
Returns true if effect is in the chain. |
boolean |
isEffected()
Returns true if at least one effect in the chain is enabled. |
boolean |
isEnabled(AudioEffect effect)
Returns true if effect is in the chain and is also enabled. |
void |
noEffects()
Disables all effects currently attached to this. |
void |
removeEffect(AudioEffect effect)
Removes effect from the effects chain. |
AudioEffect |
removeEffect(int i)
Removes and returns the ith effect in the
effect chain. |
void |
removeListener(AudioListener listener)
Removes the listener from the list of listeners. |
float |
sampleRate()
Returns the sample rate of this recordable audio. |
int |
type()
Returns either Minim.MONO or Minim.STEREO |
| Methods inherited from class ddf.minim.Controller |
|---|
balance, gain, getBalance, getControl, getControls, getGain, getPan, getVolume, hasControl, isMuted, mute, pan, printControls, setBalance, setGain, setPan, setVolume, shiftBalance, shiftGain, shiftPan, shiftVolume, unmute, volume |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final AudioBuffer left
AudioSource, it contains the single channel of audio.
public final AudioBuffer right
AudioSource, right contains the same samples
as left.
public final AudioBuffer mix
AudioSource, mix contains the same
samples as left.
| Constructor Detail |
|---|
public AudioSource(AudioOut istream)
AudioSource that will subscribe to the samples
in stream. It is expected that the stream is using a
DataLine for playback. If it is not, calls to
Controller's methods will result in a
NullPointerException.
istream - the AudioStream to subscribe to and wrap| Method Detail |
|---|
public void close()
AudioStream this was constructed with.
public void addEffect(AudioEffect effect)
Effectable
addEffect in interface Effectableeffect - the AudioEffect to addpublic void clearEffects()
Effectable
clearEffects in interface Effectablepublic void disableEffect(int i)
Effectableith effect in the effect chain.
disableEffect in interface Effectablei - the index of the effect to disablepublic void disableEffect(AudioEffect effect)
Effectableeffect if it is in the chain.
disableEffect in interface Effectableeffect - the AudioEffect to disablepublic int effectCount()
Effectable
effectCount in interface Effectablepublic void effects()
EffectableEffectable.enableEffect(int).
effects in interface Effectablepublic boolean hasEffect(AudioEffect e)
Effectableeffect is in the chain.
hasEffect in interface Effectablee - the effec to check for
effect is attached to thispublic void enableEffect(int i)
Effectableith effect in the effect chain.
enableEffect in interface Effectablei - the index of the effect to enablepublic void enableEffect(AudioEffect effect)
Effectableeffect if it is in the chain.
enableEffect in interface Effectableeffect - the AudioEffect to enablepublic AudioEffect getEffect(int i)
Effectableith effect in the effect chain.
This method is not required to do bounds checking and may throw an
ArrayOutOfBoundsException if i is larger than
Effectable.effectCount().
getEffect in interface Effectablei - which effect to return
public boolean isEffected()
Effectable
isEffected in interface Effectablepublic boolean isEnabled(AudioEffect effect)
Effectableeffect is in the chain and is also enabled.
isEnabled in interface Effectableeffect - the AudioEffect to check the status of
effect is in the chain and is enabledpublic void noEffects()
EffectableEffectable.disableEffect(int).
noEffects in interface Effectablepublic void removeEffect(AudioEffect effect)
Effectableeffect from the effects chain.
removeEffect in interface Effectableeffect - the AudioEffect to removepublic AudioEffect removeEffect(int i)
Effectableith effect in the
effect chain.
removeEffect in interface Effectablei - which effect to remove
AudioEffectpublic void addListener(AudioListener listener)
Recordable
addListener in interface Recordablelistener - the listener to addpublic int bufferSize()
Recordable
bufferSize in interface Recordablepublic javax.sound.sampled.AudioFormat getFormat()
Recordable
getFormat in interface Recordablepublic void removeListener(AudioListener listener)
Recordable
removeListener in interface Recordablelistener - the listener to removepublic int type()
Recordable
type in interface Recordablepublic float sampleRate()
Recordable
sampleRate in interface Recordable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||