micromod.output.converters
Interface AudioFormatConverter

All Known Implementing Classes:
SS16BEAudioFormatConverter, SS16LEAudioFormatConverter, UM8AudioFormatConverter

public interface AudioFormatConverter

The AudioFormatConverter interface defines a class that can convert blocks of PCM audio into different formats.


Method Summary
 void convert(short[] left, short[] right, int position, byte[] output, int length)
          Perform conversion of audio.
 int getBytesPerFrame()
           
 int getNumberOfChannels()
           
 boolean isBigEndian()
           
 boolean isSigned()
           
 

Method Detail

getBytesPerFrame

public int getBytesPerFrame()
Returns:
the number of bytes output per stereo sample of input.

getNumberOfChannels

public int getNumberOfChannels()
Returns:
2 if this converter produces stereo output, 1 if mono

isSigned

public boolean isSigned()
Returns:
true if the converter outputs signed samples

isBigEndian

public boolean isBigEndian()
Returns:
true if the converter outputs big endian samples

convert

public void convert(short[] left,
                    short[] right,
                    int position,
                    byte[] output,
                    int length)
Perform conversion of audio. length*getBytesPerFrame() bytes are written to the start of the output array.

Parameters:
left - the left buffer
right - the right buffer
position - the start position in the input buffers.
length - the number of "frames" or stereo samples to convert