interface SoundPlayer
Modifier and Type | Method and Description |
---|---|
void |
addAudioListener(AudioListener listener)
Adds a listener that will be notified of audio playback events.
|
void |
pause(AudioPlayer.Execute command,
AudioPlayer.State stateChange,
java.net.URL playingUrl)
Ask player to pause the current playing media.
|
void |
play(AudioPlayer.Execute command,
AudioPlayer.State stateChange,
java.net.URL playingUrl)
Ask player to play a new media.
|
boolean |
playing(AudioPlayer.Execute command)
Method called when a media is being played.
|
double |
position()
Returns the media playback position, in seconds.
|
double |
speed()
Returns the media playback speed ratio.
|
void play(AudioPlayer.Execute command, AudioPlayer.State stateChange, java.net.URL playingUrl) throws AudioException, java.io.IOException
command
- Command containing media informationstateChange
- the previous stateplayingUrl
- the currently playing URL, if anyAudioException
- if an audio error occursjava.io.IOException
- if an I/O error occursvoid pause(AudioPlayer.Execute command, AudioPlayer.State stateChange, java.net.URL playingUrl) throws AudioException, java.io.IOException
command
- Command containing media informationstateChange
- the previous stateplayingUrl
- the currently playing URL, if anyAudioException
- if an audio error occursjava.io.IOException
- if an I/O error occursboolean playing(AudioPlayer.Execute command) throws AudioException, java.io.IOException, java.lang.InterruptedException
command
- Command containing media informationtrue
if the playing call was blocking, and the playback is finished when this method returnsAudioException
- if an audio error occursjava.io.IOException
- if an I/O error occursjava.lang.InterruptedException
- if the play is interrupteddouble position()
double speed()
void addAudioListener(AudioListener listener)
listener
- audio listener