Package javazoom.jl.decoder
Class SampleBuffer
java.lang.Object
javazoom.jl.decoder.Obuffer
javazoom.jl.decoder.SampleBuffer
The
SampleBuffer class implements an output buffer
that provides storage for a fixed size block of samples.-
Field Summary
Fields inherited from class javazoom.jl.decoder.Obuffer
MAXCHANNELS, OBUFFERSIZE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappend(int channel, short value) Takes a 16 Bit PCM sample.voidappendSamples(int channel, float[] f) Accepts 32 new PCM samples.voidClears all data in the buffer (for seeking).voidclose()short[]intintintvoidNotify the buffer that the user has stopped the stream.voidwrite_buffer(int val) Write the samples to the file (Random Acces).
-
Constructor Details
-
SampleBuffer
public SampleBuffer(int sample_frequency, int number_of_channels) Constructor
-
-
Method Details
-
getChannelCount
public int getChannelCount() -
getSampleFrequency
public int getSampleFrequency() -
getBuffer
public short[] getBuffer() -
getBufferLength
public int getBufferLength() -
append
public void append(int channel, short value) Takes a 16 Bit PCM sample. -
appendSamples
public void appendSamples(int channel, float[] f) Description copied from class:ObufferAccepts 32 new PCM samples.- Overrides:
appendSamplesin classObuffer
-
write_buffer
public void write_buffer(int val) Write the samples to the file (Random Acces).- Specified by:
write_bufferin classObuffer
-
close
public void close() -
clear_buffer
public void clear_buffer()Description copied from class:ObufferClears all data in the buffer (for seeking).- Specified by:
clear_bufferin classObuffer
-
set_stop_flag
public void set_stop_flag()Description copied from class:ObufferNotify the buffer that the user has stopped the stream.- Specified by:
set_stop_flagin classObuffer
-