Class VorbisDecoder
- java.lang.Object
-
- com.sedmelluq.lava.common.natives.NativeResourceHolder
-
- com.sedmelluq.discord.lavaplayer.natives.vorbis.VorbisDecoder
-
public class VorbisDecoder extends com.sedmelluq.lava.common.natives.NativeResourceHolderA wrapper around the native methods of AacDecoder, which uses libvorbis native library.
-
-
Constructor Summary
Constructors Constructor Description VorbisDecoder()Create an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidfreeResources()intgetChannelCount()Get the number of channels, valid only after initialisation.voidinitialise(java.nio.ByteBuffer infoBuffer, java.nio.ByteBuffer setupBuffer)Initialize the decoder by passing in identification and setup header data.voidinput(java.nio.ByteBuffer buffer)Provide input for the decoderintoutput(float[][] channels)Fetch output from the decoder
-
-
-
Method Detail
-
initialise
public void initialise(java.nio.ByteBuffer infoBuffer, java.nio.ByteBuffer setupBuffer)Initialize the decoder by passing in identification and setup header data. See https://xiph.org/vorbis/doc/Vorbis_I_spec.html#x1-170001.2.6 for definitions. The comment header is not required as it is not actually used for decoding setup.- Parameters:
infoBuffer- Identification header, including the 'vorbis' string.setupBuffer- Setup header (also known as codebook header), including the 'vorbis' string.
-
getChannelCount
public int getChannelCount()
Get the number of channels, valid only after initialisation.- Returns:
- Number of channels
-
input
public void input(java.nio.ByteBuffer buffer)
Provide input for the decoder- Parameters:
buffer- Buffer with the input
-
output
public int output(float[][] channels)
Fetch output from the decoder- Parameters:
channels- Channel buffers to fetch the output to- Returns:
- The number of samples fetched for each channel
-
freeResources
protected void freeResources()
- Specified by:
freeResourcesin classcom.sedmelluq.lava.common.natives.NativeResourceHolder
-
-