Search in sources :

Example 1 with LavaplayerPlayerWrapper

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;
    }
}
Also used : LavaplayerPlayerWrapper(lavalink.client.player.LavaplayerPlayerWrapper)

Example 2 with LavaplayerPlayerWrapper

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;
}
Also used : LavaplayerPlayerWrapper(lavalink.client.player.LavaplayerPlayerWrapper)

Aggregations

LavaplayerPlayerWrapper (lavalink.client.player.LavaplayerPlayerWrapper)2