Class ChannelStreamLine

java.lang.Object
net.avadeaux.klipspringer.encoder.PlayerState
net.avadeaux.klipspringer.encoder.ChannelStreamLine
All Implemented Interfaces:
AutoCloseable, DataLine, Line, SourceDataLine
Direct Known Subclasses:
AuChannelStreamLine, EncoderChannelStreamLine

public abstract class ChannelStreamLine extends PlayerState implements SourceDataLine
Line for streaming audio to a channel. Data should be written in sequence from a single thread. Extends the SourceDataLine contract with the finish mehod, which should be called to make sure that no data is retained in an internal encoder buffer before at the end of playback.
  • Field Details

    • bc

      protected final WritableByteChannel bc
    • fs

      protected final int fs
    • bips

      protected final int bips
    • byps

      protected final int byps
    • bsam

      protected final int bsam
    • esam

      protected final int esam
    • dsam

      protected final int dsam
  • Constructor Details

    • ChannelStreamLine

      public ChannelStreamLine(WritableByteChannel bc, AudioFormat format, long writeAheadMillis, long timeoutMillis) throws UnsupportedAudioFileException
      Creates a line for streaming to a channel.
      Parameters:
      bc - the channel to stream to, which must be non-blocking
      format - audio format of the PCM data written to this line
      writeAheadMillis - limit for how much to write ahead of what receiver has played, Long.MAX_VALUE for unlimited
      timeoutMillis - time to wait when when write-ahead limit is reached
      Throws:
      UnsupportedAudioFileException
  • Method Details