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);
}
Aggregations