micromod.output.converters
Class SS16LEAudioFormatConverter

java.lang.Object
  extended bymicromod.output.converters.SS16LEAudioFormatConverter
All Implemented Interfaces:
AudioFormatConverter

public class SS16LEAudioFormatConverter
extends java.lang.Object
implements AudioFormatConverter

Signed, Stereo, 16 bit, Little Endian like most IBM-PC soundcards


Constructor Summary
SS16LEAudioFormatConverter()
           
 
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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SS16LEAudioFormatConverter

public SS16LEAudioFormatConverter()
Method Detail

getBytesPerFrame

public int getBytesPerFrame()
Specified by:
getBytesPerFrame in interface AudioFormatConverter
Returns:
the number of bytes output per stereo sample of input.

getNumberOfChannels

public int getNumberOfChannels()
Specified by:
getNumberOfChannels in interface AudioFormatConverter
Returns:
2 if this converter produces stereo output, 1 if mono

isSigned

public boolean isSigned()
Specified by:
isSigned in interface AudioFormatConverter
Returns:
true if the converter outputs signed samples

isBigEndian

public boolean isBigEndian()
Specified by:
isBigEndian in interface AudioFormatConverter
Returns:
true if the converter outputs big endian samples

convert

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

Specified by:
convert in interface AudioFormatConverter
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