Class AuChannelStreamLine
java.lang.Object
net.avadeaux.klipspringer.encoder.PlayerState
net.avadeaux.klipspringer.encoder.ChannelStreamLine
net.avadeaux.klipspringer.encoder.AuChannelStreamLine
- All Implemented Interfaces:
AutoCloseable,DataLine,Line,SourceDataLine
Channel stream line for Au (simple audio) encoding.
-
Nested Class Summary
Nested classes/interfaces inherited from interface javax.sound.sampled.DataLine
DataLine.Info -
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionAuChannelStreamLine(WritableByteChannel bc, AudioFormat format, long writeAheadMillis, long timeoutMillis, int bufferSamples) Creates a line for streaming in Au format to a channel. -
Method Summary
Modifier and TypeMethodDescriptionintprotected intNumber of bytes received by the line but not yet sent to the channel.voidflush()Discards buffered data that has not yet been written to the channel.intintwrite(byte[] b, int off, int len) protected voidWrites data buffered on the line to the channel.Methods inherited from class net.avadeaux.klipspringer.encoder.ChannelStreamLine
addLineListener, close, drain, finish, getControl, getControls, getFormat, getFramePosition, getLevel, getLineInfo, getLongFramePosition, getMicrosecondPosition, isActive, isControlSupported, isRunning, open, open, open, outputSamples, removeLineListener, start, stopMethods inherited from class net.avadeaux.klipspringer.encoder.PlayerState
isOpen, onClose, playedMillis, playedMillis, waitForPlayed
-
Constructor Details
-
AuChannelStreamLine
public AuChannelStreamLine(WritableByteChannel bc, AudioFormat format, long writeAheadMillis, long timeoutMillis, int bufferSamples) throws LineUnavailableException, UnsupportedAudioFileException Creates a line for streaming in Au format to a channel.- Parameters:
bc- the channel to stream to, which must be non-blockingformat- audio format of the PCM data written to this linewriteAheadMillis- limit for how much to write ahead of what receiver hasplayed, Long.MAX_VALUE for unlimitedtimeoutMillis- time to wait when when write-ahead limit is reachedbufferSamples- size of line buffer in number of sample frames- Throws:
LineUnavailableExceptionUnsupportedAudioFileException
-
-
Method Details
-
write
public int write(byte[] b, int off, int len) -
bufferedSamples
protected int bufferedSamples()Description copied from class:ChannelStreamLineNumber of bytes received by the line but not yet sent to the channel.- Specified by:
bufferedSamplesin classChannelStreamLine
-
writeBuffer
Description copied from class:ChannelStreamLineWrites data buffered on the line to the channel.- Specified by:
writeBufferin classChannelStreamLine- Throws:
IOException
-
flush
public void flush()Discards buffered data that has not yet been written to the channel. -
getBufferSize
public int getBufferSize() -
available
public int available()
-