org.tritonus.share.sampled
Interface FloatSampleInput

All Known Implementing Classes:
AmplitudeAudioInputStream, FloatAudioInputStream, FloatInputStream, ImaAdpcmFormatConversionProvider.DecodedImaAdpcmAudioInputStream, ImaAdpcmFormatConversionProvider.EncodedImaAdpcmAudioInputStream, SampleRateConversionProvider.SampleRateConverterStream, TSynchronousFilteredAudioInputStream

public interface FloatSampleInput

Master interface for all classes providing audio data in FloatSampleBuffers.


Method Summary
 int getChannels()
           
 float getSampleRate()
           
 boolean isDone()
          Determine if this stream has reached its end.
 void read(FloatSampleBuffer buffer)
          Fill the entire buffer with audio data.
 void read(FloatSampleBuffer buffer, int offset, int sampleCount)
          Fill the specified portion of the buffer with the next audio data to be read.
 

Method Detail

read

void read(FloatSampleBuffer buffer)
Fill the entire buffer with audio data. If fewer samples are read, this method will use buffer.changeSampleCount() to adjust the size of the buffer. If no samples can be written to the buffer, the buffer's sample count will be set to 0.

The buffer's channel count and sample rate may not be changed by the implementation of this method.

Parameters:
buffer - the buffer to be filled

read

void read(FloatSampleBuffer buffer,
          int offset,
          int sampleCount)
Fill the specified portion of the buffer with the next audio data to be read. If fewer samples are read, this method will use buffer.changeSampleCount() to adjust the size of the buffer. If no samples can be written to the buffer, the buffer's sample count will be set to offset.

The buffer's channel count and sample rate may not be changed by the implementation of this method.

Parameters:
buffer - the buffer to be filled
offset - the start index, in samples, where to start filling the buffer
sampleCount - the number fo samples to fill into the buffer

isDone

boolean isDone()
Determine if this stream has reached its end. If true, subsequent calls to read() will return 0-sized buffers.

Returns:
true if this stream reached its end.

getChannels

int getChannels()
Returns:
the number of audio channels of the audio data that this stream provides. If it can support a variable number of channels, this method returns AudioSystem.NOT_SPECIFIED.

getSampleRate

float getSampleRate()
Returns:
the sample rate of the audio data that this stream provides. If it can support different sample rates, this method returns a negative number, e.g. AudioSystem.NOT_SPECIFIED.