Search in sources :

Example 1 with AudioConfiguration

use of com.sedmelluq.discord.lavaplayer.player.AudioConfiguration in project lavaplayer by sedmelluq.

the class TrackStartRequestCodec method decode.

@Override
public TrackStartRequestMessage decode(DataInput in, int version) throws IOException {
    long executorId = in.readLong();
    AudioTrackInfo trackInfo = new AudioTrackInfo(in.readUTF(), in.readUTF(), in.readLong(), in.readUTF(), in.readBoolean(), null);
    byte[] encodedTrack = new byte[in.readInt()];
    in.readFully(encodedTrack);
    int volume = in.readInt();
    AudioConfiguration configuration = new AudioConfiguration();
    configuration.setResamplingQuality(AudioConfiguration.ResamplingQuality.valueOf(in.readUTF()));
    configuration.setOpusEncodingQuality(in.readInt());
    if (version >= VERSION_WITH_FORMAT) {
        AudioDataFormat format = new AudioDataFormat(in.readInt(), in.readInt(), in.readInt(), AudioDataFormat.Codec.valueOf(in.readUTF()));
        configuration.setOutputFormat(format);
    }
    long position = 0;
    if (version >= VERSION_WITH_POSITION) {
        position = in.readLong();
    }
    return new TrackStartRequestMessage(executorId, trackInfo, encodedTrack, volume, configuration, position);
}
Also used : AudioConfiguration(com.sedmelluq.discord.lavaplayer.player.AudioConfiguration) AudioDataFormat(com.sedmelluq.discord.lavaplayer.format.AudioDataFormat) AudioTrackInfo(com.sedmelluq.discord.lavaplayer.track.AudioTrackInfo)

Aggregations

AudioDataFormat (com.sedmelluq.discord.lavaplayer.format.AudioDataFormat)1 AudioConfiguration (com.sedmelluq.discord.lavaplayer.player.AudioConfiguration)1 AudioTrackInfo (com.sedmelluq.discord.lavaplayer.track.AudioTrackInfo)1