javazoom.jl.player

Class Player

public class Player extends Object

The Player class implements a simple player for playback of an MPEG audio stream.

Since: 0.0.8

Constructor Summary
Player(InputStream stream)
Creates a new Player instance.
Player(InputStream stream, AudioDevice device)
Method Summary
voidclose()
Cloases this player.
protected booleandecodeFrame()
Decodes a single frame.
intgetPosition()
Retrieves the position in milliseconds of the current audio sample being played.
booleanisComplete()
Returns the completed status of this player.
voidplay()
booleanplay(int frames)
Plays a number of MPEG audio frames.

Constructor Detail

Player

public Player(InputStream stream)
Creates a new Player instance.

Player

public Player(InputStream stream, AudioDevice device)

Method Detail

close

public void close()
Cloases this player. Any audio currently playing is stopped immediately.

decodeFrame

protected boolean decodeFrame()
Decodes a single frame.

Returns: true if there are no more frames to decode, false otherwise.

getPosition

public int getPosition()
Retrieves the position in milliseconds of the current audio sample being played. This method delegates to the AudioDevice that is used by this player to sound the decoded audio samples.

isComplete

public boolean isComplete()
Returns the completed status of this player.

Returns: true if all available MPEG audio frames have been decoded, or false otherwise.

play

public void play()

play

public boolean play(int frames)
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.

JavaZOOM 1999-2005