Class LameChannelStreamLine
java.lang.Object
net.avadeaux.klipspringer.encoder.PlayerState
net.avadeaux.klipspringer.encoder.ChannelStreamLine
net.avadeaux.klipspringer.encoder.EncoderChannelStreamLine
net.avadeaux.klipspringer.encoder.LameChannelStreamLine
- All Implemented Interfaces:
AutoCloseable,DataLine,Line,SourceDataLine
Channel stream line for MP3 encoding.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.avadeaux.klipspringer.encoder.EncoderChannelStreamLine
EncoderChannelStreamLine.EncoderFactoryNested classes/interfaces inherited from interface javax.sound.sampled.DataLine
DataLine.Info -
Field Summary
Fields inherited from class net.avadeaux.klipspringer.encoder.EncoderChannelStreamLine
buf -
Constructor Summary
ConstructorsConstructorDescriptionLameChannelStreamLine(WritableByteChannel bc, AudioFormat format, int brate, int quality, long writeAheadMillis, long timeoutMillis, int bufferSamples) Constructs a line for encoding either native FLAC or Ogg FLAC. -
Method Summary
Modifier and TypeMethodDescriptionintbitrate()protected voidfinish(long handle) protected voidfree(long handle) protected longoutputSamples(long handle) intwrite(byte[] b, int off, int len) protected voidwriteBuffer(long handle, int samples) Methods inherited from class net.avadeaux.klipspringer.encoder.EncoderChannelStreamLine
available, bufferedSamples, close, finish, flush, getBufferSize, outputSamples, writeBufferMethods inherited from class net.avadeaux.klipspringer.encoder.ChannelStreamLine
addLineListener, drain, getControl, getControls, getFormat, getFramePosition, getLevel, getLineInfo, getLongFramePosition, getMicrosecondPosition, isActive, isControlSupported, isRunning, open, open, open, removeLineListener, start, stopMethods inherited from class net.avadeaux.klipspringer.encoder.PlayerState
isOpen, onClose, playedMillis, playedMillis, waitForPlayed
-
Constructor Details
-
LameChannelStreamLine
public LameChannelStreamLine(WritableByteChannel bc, AudioFormat format, int brate, int quality, long writeAheadMillis, long timeoutMillis, int bufferSamples) throws IOException, UnsupportedAudioFileException Constructs a line for encoding either native FLAC or Ogg FLAC.- Parameters:
bc- the channel to stream to, which must be non-blockingformat- audio format of the PCM data written to this linebrate- bitrate, kbpsquality- algorithm quality selection in Lame APIwriteAheadMillis- limit for how much to write ahead of what receiver hasplayed; use 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:
IOExceptionUnsupportedAudioFileException
-
-
Method Details
-
write
public int write(byte[] b, int off, int len) -
bitrate
public int bitrate() -
writeBuffer
- Specified by:
writeBufferin classEncoderChannelStreamLine- Throws:
IOException
-
finish
- Specified by:
finishin classEncoderChannelStreamLine- Throws:
IOException
-
free
protected void free(long handle) - Specified by:
freein classEncoderChannelStreamLine
-
outputSamples
protected long outputSamples(long handle) - Specified by:
outputSamplesin classEncoderChannelStreamLine
-