|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectddf.minim.Controller
ddf.minim.AudioFile
AudioFile is used for playing audio files, whether they are
on the local file system or streaming from the web. The interface is
identical to an AudioSnippet, the only difference being that samples
are available. This means that you can do things like draw the waveform,
attach AudioEffects, and use different audio analysis classes
with it. You get an AudioFile by asking Minim
for one.
| 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 |
| Method Summary | |
void |
addEffect(AudioEffect e)
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 Recordable. |
void |
clearEffects()
Removes all effects from the effect chain. |
void |
cue(int millis)
Sets the position to millis milliseconds from
the beginning. |
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(int i)
Enables the ith effect in the effect chain. |
AudioEffect |
getEffect(int i)
Returns the ith effect in the effect chain. |
boolean |
isEffected()
Returns true if at least one effect in the chain is enabled. |
boolean |
isLooping()
Returns true if this is currently playing and has more than one loop left to play. |
boolean |
isPlaying()
Returns true if this currently playing. |
int |
length()
Returns the length of the sound in milliseconds. |
void |
loop()
Sets looping to continuous. |
void |
loop(int num)
Sets this to loop num times. |
void |
noEffects()
Disables all effects currently attached to this. |
void |
pause()
Pauses playback. |
void |
play()
Starts playback from the current position. |
void |
play(int millis)
Starts playback millis from the beginning. |
int |
position()
Returns the current position of the "playhead" (ie how much of the sound has already been played) |
void |
removeEffect(AudioEffect e)
Removes e 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. |
void |
rewind()
Rewinds to the beginning. |
| Methods inherited from class ddf.minim.Controller |
balance, gain, getBalance, getControls, getFormat, getGain, getPan, getVolume, hasControl, isMuted, mute, pan, printControls, sampleRate, setBalance, setGain, setPan, setVolume, shiftBalance, shiftGain, shiftPan, shiftVolume, type, unmute, volume |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface ddf.minim.Recordable |
getFormat |
| Field Detail |
public final AudioBuffer left
AudioFile, it contains the single
channel of audio.
public final AudioBuffer right
AudioFile,
right contains the same samples as left.
public final AudioBuffer mix
AudioFile,
mix simply contains the same samples as left.
| Method Detail |
public void addEffect(AudioEffect e)
Effectable
addEffect in interface Effectablee - the AudioEffect to addpublic int effectCount()
Effectable
effectCount in interface Effectablepublic void clearEffects()
Effectable
clearEffects in interface Effectablepublic void effects()
EffectableEffectable.enableEffect(int).
effects in interface Effectablepublic 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 void enableEffect(int i)
Effectableith effect in the effect chain.
enableEffect in interface Effectablei - the index of the effect to enablepublic void disableEffect(int i)
Effectableith effect in the effect chain.
disableEffect in interface Effectablei - the index of the effect to disablepublic boolean isEffected()
Effectable
isEffected in interface Effectablepublic void noEffects()
EffectableEffectable.disableEffect(int).
noEffects in interface Effectablepublic void removeEffect(AudioEffect e)
Effectablee from the effects chain.
removeEffect in interface Effectablee - the AudioEffect to removepublic AudioEffect removeEffect(int i)
Effectableith effect in the effect chain.
removeEffect in interface Effectablei - which effect to remove
AudioEffectpublic void cue(int millis)
Playablemillis milliseconds from
the beginning. This will not change the playstate. If an error
occurs while trying to cue, it will be reported and
this will be rewound.
cue in interface Playablemillis - the position to place the "playhead"public boolean isLooping()
Playable
isLooping in interface Playablepublic boolean isPlaying()
Playable
isPlaying in interface Playablepublic int length()
Playable
length in interface Playablepublic void loop()
Playable
loop in interface Playablepublic void loop(int num)
Playablenum times. If this is already playing,
the position will not be reset to the beginning.
If this is not playing, it will start playing.
loop in interface Playablenum - the number of times to looppublic void pause()
Playable
pause in interface Playablepublic void play()
Playable
play in interface Playablepublic void play(int millis)
Playablemillis from the beginning.
play in interface Playablemillis - public int position()
Playable
position in interface Playablepublic void rewind()
Playable
rewind in interface Playablepublic void addListener(AudioListener listener)
Recordable
addListener in interface Recordablelistener - the listener to addpublic int bufferSize()
Recordable
bufferSize in interface Recordablepublic void removeListener(AudioListener listener)
Recordable
removeListener in interface Recordablelistener - the listener to remove
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||