Class EncoderChannelStreamLine

All Implemented Interfaces:
AutoCloseable, DataLine, Line, SourceDataLine
Direct Known Subclasses:
FlacChannelStreamLine, LameChannelStreamLine

public abstract class EncoderChannelStreamLine extends ChannelStreamLine
Abstract line that organizes audio channels in separate buffers.
  • Field Details

  • Constructor Details

  • Method Details

    • bufferedSamples

      protected int bufferedSamples()
      Description copied from class: ChannelStreamLine
      Number of bytes received by the line but not yet sent to the channel.
      Specified by:
      bufferedSamples in class ChannelStreamLine
    • writeBuffer

      protected void writeBuffer() throws IOException
      Description copied from class: ChannelStreamLine
      Writes data buffered on the line to the channel.
      Specified by:
      writeBuffer in class ChannelStreamLine
      Throws:
      IOException
    • flush

      public void flush()
      Discards buffered data that has not yet been written to the channel.
    • finish

      public void finish()
      Description copied from class: ChannelStreamLine
      Emits buffered data and any data buffered in encoder. Default implementation just calls drain.
      Overrides:
      finish in class ChannelStreamLine
    • close

      public void close()
      Description copied from class: ChannelStreamLine
      Closes the line and the destination channel, without writing anything. In order for all data to be emitted, finish should be called before close.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Line
      Overrides:
      close in class ChannelStreamLine
    • getBufferSize

      public int getBufferSize()
    • available

      public int available()
    • outputSamples

      protected long outputSamples()
      Description copied from class: ChannelStreamLine
      Number of samples known to have been sent to the client endpoint for playing. The default implementation returns the number of samples sent to the channel. Needs to be overridden if there is buffering/compression from this point that may cause a delay in the client playing. The number returned by this method may be slightly lower than the actual number output to the endpoint but must never be higher.
      Overrides:
      outputSamples in class ChannelStreamLine
    • writeBuffer

      protected abstract void writeBuffer(long handle, int samples) throws IOException
      Throws:
      IOException
    • finish

      protected abstract void finish(long handle) throws IOException
      Throws:
      IOException
    • free

      protected abstract void free(long handle)
    • outputSamples

      protected abstract long outputSamples(long handle)