Search in sources :

Example 1 with MpegFileLoader

use of com.sedmelluq.discord.lavaplayer.container.mpeg.MpegFileLoader in project lavaplayer by sedmelluq.

the class YoutubeMpegStreamAudioTrack method processSegmentStream.

private void processSegmentStream(SeekableInputStream stream, AudioProcessingContext context, TrackState state) throws InterruptedException {
    MpegFileLoader file = new MpegFileLoader(stream);
    file.parseHeaders();
    state.absoluteSequence = extractAbsoluteSequenceFromEvent(file.getLastEventMessage());
    if (state.trackConsumer == null) {
        state.trackConsumer = loadAudioTrack(file, context);
    }
    MpegFileTrackProvider fileReader = file.loadReader(state.trackConsumer);
    if (fileReader == null) {
        throw new FriendlyException("Unknown MP4 format.", SUSPICIOUS, null);
    }
    fileReader.provideFrames();
}
Also used : MpegFileLoader(com.sedmelluq.discord.lavaplayer.container.mpeg.MpegFileLoader) MpegFileTrackProvider(com.sedmelluq.discord.lavaplayer.container.mpeg.reader.MpegFileTrackProvider) FriendlyException(com.sedmelluq.discord.lavaplayer.tools.FriendlyException)

Aggregations

MpegFileLoader (com.sedmelluq.discord.lavaplayer.container.mpeg.MpegFileLoader)1 MpegFileTrackProvider (com.sedmelluq.discord.lavaplayer.container.mpeg.reader.MpegFileTrackProvider)1 FriendlyException (com.sedmelluq.discord.lavaplayer.tools.FriendlyException)1