|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectddf.minim.Controller
ddf.minim.AudioObject
ddf.minim.AudioFileIn
AudioFileIn 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 AudioClip, 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 AudioFileIn by asking Minim
for one.
| Field Summary | |
protected javax.sound.sampled.AudioInputStream |
ais
|
protected long |
bytesRead
|
protected int |
lengthInMillis
|
protected boolean |
loop
|
protected int |
numLoops
|
protected boolean |
play
|
| Fields inherited from class ddf.minim.AudioObject |
doEffects, effects, left, mix, right |
| Fields inherited from class ddf.minim.Controller |
BALANCE, GAIN, line, MUTE, PAN, VOLUME |
| Constructor Summary | |
AudioFileIn(javax.sound.sampled.AudioInputStream ais,
javax.sound.sampled.SourceDataLine line,
int bufferSize)
Constructs an AudioFileIn object. |
|
| Method Summary | |
void |
cue(int millis)
Sets the position of the file to millis milliseconds from
the beginning. |
boolean |
isPlaying()
Returns true if the AudioFileIn is currently playing. |
int |
length()
Returns the length of the file 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. |
void |
writeSamples(org.tritonus.share.sampled.FloatSampleBuffer fsb)
Fills fsb with samples from the file. |
| Methods inherited from class ddf.minim.AudioObject |
addEffect, applyEffects, applyEffects, clearEffects, effects, getEffect, getFormat, isEffected, noEffects, removeEffect, removeEffect, type |
| 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 |
| Field Detail |
protected long bytesRead
protected int lengthInMillis
protected boolean play
protected boolean loop
protected int numLoops
protected javax.sound.sampled.AudioInputStream ais
| Constructor Detail |
public AudioFileIn(javax.sound.sampled.AudioInputStream ais,
javax.sound.sampled.SourceDataLine line,
int bufferSize)
ais - the AudioInputStream that contains the audio samplesline - the SourceDataLine that will be used to play the samplesbufferSize - the size of the float buffers| Method Detail |
public void play()
public void play(int millis)
millis from the beginning.
millis - public boolean isPlaying()
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 file. If an error
occurs while trying to cue the file, it will be reported and the file will
be rewound.
millis - public void writeSamples(org.tritonus.share.sampled.FloatSampleBuffer fsb)
fsb with samples from the file. If an error occurs
while reading from the file, it will be reported and fsb
will be filled with silence.
writeSamples in interface AWListenerfsb - the FloatSampleBuffer to be filled
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||