Class VorbisDecoder


  • public class VorbisDecoder
    extends com.sedmelluq.lava.common.natives.NativeResourceHolder
    A 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 void freeResources()  
      int getChannelCount()
      Get the number of channels, valid only after initialisation.
      void initialise​(java.nio.ByteBuffer infoBuffer, java.nio.ByteBuffer setupBuffer)
      Initialize the decoder by passing in identification and setup header data.
      void input​(java.nio.ByteBuffer buffer)
      Provide input for the decoder
      int output​(float[][] channels)
      Fetch output from the decoder
      • Methods inherited from class com.sedmelluq.lava.common.natives.NativeResourceHolder

        checkNotReleased, close, finalize
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • VorbisDecoder

        public VorbisDecoder()
        Create an instance.
    • 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:
        freeResources in class com.sedmelluq.lava.common.natives.NativeResourceHolder