ddf.minim.spi
Interface AudioStream

All Superinterfaces:
AudioResource
All Known Subinterfaces:
AudioRecording, AudioRecordingStream

public interface AudioStream
extends AudioResource

An AudioStream is a stream of samples that is coming from somewhere. Users of an AudioStream don't really need to know where the samples are coming from. However, typically they will be read from a Line or a file. An AudioStream needs to be opened before being used and closed when you are finished with it.

Author:
Damien Di Fede

Method Summary
 float[] read()
          Reads the next sample frame.
 void read(MultiChannelBuffer buffer)
          Reads buffer.getBufferSize() sample frames and puts them into buffer's channels.
 
Methods inherited from interface ddf.minim.spi.AudioResource
close, getControls, getFormat, open
 

Method Detail

read

float[] read()
Reads the next sample frame.

Returns:
an array of floats containing the value of each channel in the sample frame just read. The size of the returned array will be the same size as getFormat().getChannels().

read

void read(MultiChannelBuffer buffer)
Reads buffer.getBufferSize() sample frames and puts them into buffer's channels. The provided buffer will be forced to have the same number of channels that this AudioStream does.

Parameters:
buffer - The MultiChannelBuffer to fill with audio samples.