Class OggOpusTrackHandler
- java.lang.Object
-
- com.sedmelluq.discord.lavaplayer.container.ogg.opus.OggOpusTrackHandler
-
- All Implemented Interfaces:
OggTrackHandler,java.io.Closeable,java.lang.AutoCloseable
public class OggOpusTrackHandler extends java.lang.Object implements OggTrackHandler
OGG stream handler for Opus codec.
-
-
Constructor Summary
Constructors Constructor Description OggOpusTrackHandler(OggPacketInputStream packetInputStream, DirectBufferStreamBroker broker, int channelCount, int sampleRate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidinitialise(AudioProcessingContext context, long timecode, long desiredTimecode)Initialises the track stream.voidprovideFrames()Decodes audio frames and sends them to frame consumer.voidseekToTimecode(long timecode)Seeks to the specified timecode.
-
-
-
Constructor Detail
-
OggOpusTrackHandler
public OggOpusTrackHandler(OggPacketInputStream packetInputStream, DirectBufferStreamBroker broker, int channelCount, int sampleRate)
- Parameters:
packetInputStream- OGG packet input streambroker- Broker for loading stream data into direct byte buffer.channelCount- Number of channels in the track.sampleRate- Sample rate of the track.
-
-
Method Detail
-
initialise
public void initialise(AudioProcessingContext context, long timecode, long desiredTimecode)
Description copied from interface:OggTrackHandlerInitialises the track stream.- Specified by:
initialisein interfaceOggTrackHandler- Parameters:
context- Configuration and output information for processing
-
provideFrames
public void provideFrames() throws java.lang.InterruptedExceptionDescription copied from interface:OggTrackHandlerDecodes audio frames and sends them to frame consumer.- Specified by:
provideFramesin interfaceOggTrackHandler- Throws:
java.lang.InterruptedException- When interrupted externally (or for seek/stop).
-
seekToTimecode
public void seekToTimecode(long timecode)
Description copied from interface:OggTrackHandlerSeeks to the specified timecode.- Specified by:
seekToTimecodein interfaceOggTrackHandler- Parameters:
timecode- The timecode in milliseconds
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
-