use of lavalink.client.player.LavaplayerPlayerWrapper in project FredBoat by Frederikam.
the class AbstractPlayer method canProvide.
@Override
public boolean canProvide() {
LavaplayerPlayerWrapper lavaplayerPlayer = (LavaplayerPlayerWrapper) player;
lastFrame = lavaplayerPlayer.provide();
if (lastFrame == null) {
audioLossCounter.onLoss();
return false;
} else {
audioLossCounter.onSuccess();
return true;
}
}
use of lavalink.client.player.LavaplayerPlayerWrapper in project SkyBot by duncte123.
the class AudioPlayerSenderHandler method provide20MsAudio.
/**
* This <em>should</em> gives us our audio
*
* @return The audio in some nice bytes
*/
@Override
public byte[] provide20MsAudio() {
LavaplayerPlayerWrapper lavaplayerPlayer = (LavaplayerPlayerWrapper) audioPlayer;
if (lastFrame == null) {
lastFrame = lavaplayerPlayer.provide();
}
byte[] data = lastFrame != null ? lastFrame.data : null;
lastFrame = null;
return data;
}
Aggregations