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 newPlayer
instance.AdvancedPlayer
(InputStream stream, AudioDevice device) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Cloases this player.protected boolean
Decodes a single frame.gets thePlaybackListener
void
play()
boolean
play
(int frames) Plays a number of MPEG audio frames.boolean
play
(int start, int end) Plays a range of MPEG audio framesvoid
setPlayBackListener
(PlaybackListener listener) sets thePlaybackListener
protected boolean
skips over a single framevoid
stop()
closes the player and notifiesPlaybackListener
-
Constructor Details
-
AdvancedPlayer
Creates a newPlayer
instance.- 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
-