public class Player
extends java.lang.Object
Player
class implements a simple player for playback
of an MPEG audio stream.Constructor and Description |
---|
Player(java.io.InputStream stream)
Creates a new
Player instance. |
Player(java.io.InputStream stream,
AudioDevice device) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Cloases this player.
|
protected boolean |
decodeFrame()
Decodes a single frame.
|
int |
getPosition()
Retrieves the position in milliseconds of the current audio
sample being played.
|
boolean |
isComplete()
Returns the completed status of this player.
|
void |
play() |
boolean |
play(int frames)
Plays a number of MPEG audio frames.
|
public Player(java.io.InputStream stream) throws JavaLayerException
Player
instance.JavaLayerException
public Player(java.io.InputStream stream, AudioDevice device) throws JavaLayerException
JavaLayerException
public void play() throws JavaLayerException
JavaLayerException
public boolean play(int frames) throws JavaLayerException
frames
- The number of frames to play.JavaLayerException
public void close()
public boolean isComplete()
public int getPosition()
AudioDevice
that is used by this player to sound
the decoded audio samples.protected boolean decodeFrame() throws JavaLayerException
JavaLayerException