Interface AudioPlayer
-
- All Superinterfaces:
AudioFrameProvider
- All Known Implementing Classes:
DefaultAudioPlayer
public interface AudioPlayer extends AudioFrameProvider
An audio player that is capable of playing audio tracks and provides audio frames from the currently playing track.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddListener(AudioEventListener listener)Add a listener to events from this player.voidcheckCleanup(long threshold)Check if the player should be "cleaned up" - stopped due to nothing using it, with the given threshold.voiddestroy()Destroy the player and stop playing track.AudioTrackgetPlayingTrack()intgetVolume()booleanisPaused()voidplayTrack(AudioTrack track)voidremoveListener(AudioEventListener listener)Remove an attached listener using identity comparison.voidsetFilterFactory(PcmFilterFactory factory)voidsetFrameBufferDuration(java.lang.Integer duration)voidsetPaused(boolean value)voidsetVolume(int volume)booleanstartTrack(AudioTrack track, boolean noInterrupt)voidstopTrack()Stop currently playing track.-
Methods inherited from interface com.sedmelluq.discord.lavaplayer.track.playback.AudioFrameProvider
provide, provide, provide, provide
-
-
-
-
Method Detail
-
getPlayingTrack
AudioTrack getPlayingTrack()
- Returns:
- Currently playing track
-
playTrack
void playTrack(AudioTrack track)
- Parameters:
track- The track to start playing
-
startTrack
boolean startTrack(AudioTrack track, boolean noInterrupt)
- Parameters:
track- The track to start playing, passing null will stop the current track and return falsenoInterrupt- Whether to only start if nothing else is playing- Returns:
- True if the track was started
-
stopTrack
void stopTrack()
Stop currently playing track.
-
getVolume
int getVolume()
-
setVolume
void setVolume(int volume)
-
setFilterFactory
void setFilterFactory(PcmFilterFactory factory)
-
setFrameBufferDuration
void setFrameBufferDuration(java.lang.Integer duration)
-
isPaused
boolean isPaused()
- Returns:
- Whether the player is paused
-
setPaused
void setPaused(boolean value)
- Parameters:
value- True to pause, false to resume
-
destroy
void destroy()
Destroy the player and stop playing track.
-
addListener
void addListener(AudioEventListener listener)
Add a listener to events from this player.- Parameters:
listener- New listener
-
removeListener
void removeListener(AudioEventListener listener)
Remove an attached listener using identity comparison.- Parameters:
listener- The listener to remove
-
checkCleanup
void checkCleanup(long threshold)
Check if the player should be "cleaned up" - stopped due to nothing using it, with the given threshold.- Parameters:
threshold- Threshold in milliseconds to use
-
-