Package com.nerius.audio
Interface AudioClip
-
- All Known Implementing Classes:
ModernAudioClip
public interface AudioClip
This class is similar tojava.applet.AudioClip
only with added methodspause()
andresume()
. The originalAudioClip
interface definition in packagejava.applet
is deprecated and is in danger of being removed altogether; for that reason we don't even want to extend from it here.The minimal implementation requirement for an instance of this interface is for it to support being called from two different threads; one thread would be responsible for calling
play()
,loop()
, andstop()
, while the other thread would be responsible for callingpause()
andresume()
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
loop()
Plays the audio clip once through, then jumps back to beginning, playing it through again and again, indefinitely.void
pause()
Puts the audio clip into paused state, if not already.void
play()
Plays the audio clip once through.void
resume()
Resumes the clip after paused state, if clip was paused previously.void
stop()
Stops a playing or looping audio clip.
-
-
-
Method Detail
-
play
void play()
Plays the audio clip once through. This always causes the playing to start from beginning of clip, even in cases where clip is already playing or looping.
-
loop
void loop()
Plays the audio clip once through, then jumps back to beginning, playing it through again and again, indefinitely. This always causes the playing to start from beginning of clip, even in cases where clip is already playing or looping.
-
stop
void stop()
Stops a playing or looping audio clip. The next time the clip is played or looped it will start from beginning of clip.
-
pause
void pause()
Puts the audio clip into paused state, if not already. When the clip is resumed it will continue exactly where it left off when it was paused. Ifplay()
,loop()
, orstop()
are called while the clip is paused, then uponresume()
the clip will behave as if calling those operations in the same order immediately upon resume.
-
resume
void resume()
Resumes the clip after paused state, if clip was paused previously. For clarification on required behavior of pause/resume please see discussion onpause()
.- See Also:
pause()
-
-