|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectddf.minim.Controller
ddf.minim.AudioClip
AudioClip is a simple wrapper around a JavaSound Clip. It
provides almost the exact same functionality, the main difference being that
length, position, and cue are expressed in milliseconds instead of
microseconds. You can obtain an AudioClip by using
MInim.loadClip(). One of the limitations of AudioClip is that
you do not have access to the audio samples as they are played. However, you
are spared all of the overhead associated with making samples available. An
AudioClip is a good choice if all you need to do is play a short sound at
some point. If your aim is to repeatedly trigger a sound, you should use an
AudioSample instead.
| Field Summary |
| Fields inherited from class ddf.minim.Controller |
BALANCE, GAIN, line, MUTE, PAN, VOLUME |
| Constructor Summary | |
AudioClip(javax.sound.sampled.Clip c)
Constructs an AudioClip using the passed Clip. |
|
| Method Summary | |
void |
cue(int millis)
Sets the position of the clip to millis milliseconds from
the beginning. |
int |
length()
Returns the length of the AudioClip in milliseconds. |
void |
loop()
Sets the clip to loop continuously. |
void |
loop(int n)
Sets the clip to loop n times. |
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" in the clip (ie how much of the clip has already been played) |
void |
rewind()
Rewinds the clip to the beginning. |
| Methods inherited from class ddf.minim.Controller |
getBalance, getGain, getPan, getVolume, isMuted, mute, printControls, setBalance, setGain, setPan, setVolume, shiftBalance, shiftGain, shiftPan, shiftVolume, unmute |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public AudioClip(javax.sound.sampled.Clip c)
c - the Clip to wrap| Method Detail |
public void play()
public void play(int millis)
millis from the beginning.
millis - public void pause()
public void rewind()
public void loop()
public void loop(int n)
n times. If it is already playing,
this will not reset the position to the beginning. If it is not
playing, this will cause the clip to start playing.
n - the number of times to looppublic int length()
public int position()
public void cue(int millis)
millis milliseconds from
the beginning. This will not change the playstate of the clip.
millis - how many milliseconds from the beginning to place the "playhead"
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||