Class OpusPacketRouter
- java.lang.Object
-
- com.sedmelluq.discord.lavaplayer.container.common.OpusPacketRouter
-
public class OpusPacketRouter extends java.lang.ObjectA router for opus packets to the output specified by an audio processing context. It automatically detects if the packets can go clean through to the output without any decoding and encoding steps on each packet and rebuilds the pipeline of the output if necessary.
-
-
Constructor Summary
Constructors Constructor Description OpusPacketRouter(AudioProcessingContext context, int inputFrequency, int inputChannels)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Free all resources.voidflush()Indicates that no more input is coming.voidprocess(java.nio.ByteBuffer buffer)Process one opus packet.voidseekPerformed(long requestedTimecode, long providedTimecode)Notify downstream handlers about a seek.
-
-
-
Constructor Detail
-
OpusPacketRouter
public OpusPacketRouter(AudioProcessingContext context, int inputFrequency, int inputChannels)
- Parameters:
context- Configuration and output information for processinginputFrequency- Sample rate of the opus trackinputChannels- Number of channels in the opus track
-
-
Method Detail
-
seekPerformed
public void seekPerformed(long requestedTimecode, long providedTimecode)Notify downstream handlers about a seek.- Parameters:
requestedTimecode- Timecode in milliseconds to which the seek was requested toprovidedTimecode- Timecode in milliseconds to which the seek was actually performed to
-
flush
public void flush() throws java.lang.InterruptedExceptionIndicates that no more input is coming. Flush any buffers to output.- Throws:
java.lang.InterruptedException- When interrupted externally (or for seek/stop).
-
process
public void process(java.nio.ByteBuffer buffer) throws java.lang.InterruptedExceptionProcess one opus packet.- Parameters:
buffer- Byte buffer of the packet- Throws:
java.lang.InterruptedException- When interrupted externally (or for seek/stop).
-
close
public void close()
Free all resources.
-
-