| |
e731. Determining When a Sampled Audio Player Has Finished Playing
An audio clip fires a line event when the audio sample has finished
playing. If the audio clip is played in a loop (see
e725 Continuously Playing a Sampled Audio File), the event is fired
only after the loop is finished.
// To create a Clip object, see e723 Loading and Playing Sampled Audio
// Add a listener for line events
clip.addLineListener(new LineListener() {
public void update(LineEvent evt) {
if (evt.getType() == LineEvent.Type.STOP) {
}
}
});
© 2002 Addison-Wesley.
|