Package javazoom.jl.player.advanced
Class AdvancedPlayer
java.lang.Object
javazoom.jl.player.advanced.AdvancedPlayer
a hybrid of javazoom.jl.player.Player tweeked to include
play(startFrame, endFrame)
hopefully this will be included in the api-
Constructor Summary
ConstructorsConstructorDescriptionAdvancedPlayer(InputStream stream) Creates a newPlayerinstance.AdvancedPlayer(InputStream stream, AudioDevice device) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Cloases this player.protected booleanDecodes a single frame.gets thePlaybackListenervoidplay()booleanplay(int frames) Plays a number of MPEG audio frames.booleanplay(int start, int end) Plays a range of MPEG audio framesvoidsetPlayBackListener(PlaybackListener listener) sets thePlaybackListenerprotected booleanskips over a single framevoidstop()closes the player and notifiesPlaybackListener
-
Constructor Details
-
AdvancedPlayer
Creates a newPlayerinstance.- Throws:
JavaLayerException
-
AdvancedPlayer
- Throws:
JavaLayerException
-
-
Method Details
-
play
- Throws:
JavaLayerException
-
play
Plays a number of MPEG audio frames.- Parameters:
frames- The number of frames to play.- Returns:
- true if the last frame was played, or false if there are more frames.
- Throws:
JavaLayerException
-
close
public void close()Cloases this player. Any audio currently playing is stopped immediately. -
decodeFrame
Decodes a single frame.- Returns:
- true if there are no more frames to decode, false otherwise.
- Throws:
JavaLayerException
-
skipFrame
skips over a single frame- Returns:
- false if there are no more frames to decode, true otherwise.
- Throws:
JavaLayerException
-
play
Plays a range of MPEG audio frames- Parameters:
start- The first frame to playend- The last frame to play- Returns:
- true if the last frame was played, or false if there are more frames.
- Throws:
JavaLayerException
-
setPlayBackListener
sets thePlaybackListener -
getPlayBackListener
gets thePlaybackListener -
stop
public void stop()closes the player and notifiesPlaybackListener
-