Class PcmChunkEncoder

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Frees up all held resources.
      byte[] encode​(java.nio.ShortBuffer buffer)  
      void encode​(java.nio.ShortBuffer buffer, java.nio.ByteBuffer out)  
      • Methods inherited from class java.lang.Object

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

      • PcmChunkEncoder

        public PcmChunkEncoder​(AudioDataFormat format,
                               boolean bigEndian)
        Parameters:
        format - Target audio format.
        bigEndian - Whether the samples are in big-endian format (as opposed to little-endian).
    • Method Detail

      • encode

        public byte[] encode​(java.nio.ShortBuffer buffer)
        Specified by:
        encode in interface AudioChunkEncoder
        Parameters:
        buffer - Input buffer containing the PCM samples.
        Returns:
        Encoded bytes
      • encode

        public void encode​(java.nio.ShortBuffer buffer,
                           java.nio.ByteBuffer out)
        Specified by:
        encode in interface AudioChunkEncoder
        Parameters:
        buffer - Input buffer containing the PCM samples.
        out - Output buffer to store the encoded bytes in