SampleConverter Class 
Namespace: Accord.Audio
Name  Description  

Convert(Byte, Int16) 
Converts a unsigned 8bit byte sample
into a 16bit short integer sample.
 
Convert(Byte, Int32) 
Converts a unsigned 8bit byte sample
into a 32bit integer sample.
 
Convert(Byte, Single) 
Converts a unsigned 8bit byte sample
into a 32bit floating point sample.
 
Convert(Byte, Int16) 
Converts an array of unsigned 8bit byte samples
into an array of 16bit short integer samples.
 
Convert(Byte, Int32) 
Converts an array of unsigned 8bit byte samples
into an array of 32bit integer samples.
 
Convert(Byte, Single) 
Converts an array of unsigned 8bit byte samples
into an array of 32bit floating point samples.
 
Convert(Byte, Int16) 
Converts a matrix of unsigned 8bit byte samples
into a array of 16bit short integer samples.
 
Convert(Byte, Int32) 
Converts a matrix of unsigned 8bit byte samples
into a matrix of 32bit integer samples.
 
Convert(Byte, Single) 
Converts a matrix of unsigned 8bit byte samples
into a matrix of 32bit floatingpoint samples.
 
Convert(Int16, Byte) 
Converts a signed 16bit integer sample
into a 8bit unsigned byte sample.
 
Convert(Int16, Double) 
Converts a signed 16bit integer sample
into a 64bit floating point sample.
 
Convert(Int16, Int32) 
Converts a signed 16bit integer sample
into a 32bit signed integer sample.
 
Convert(Int16, Single) 
Converts a signed 16bit integer sample
into a 32bit floating point sample.
 
Convert(Int16, Byte) 
Converts a array of signed 16bit integer samples
into a array of 8bit unsigned byte samples.
 
Convert(Int16, Double) 
Converts a array of signed 16bit integer samples
into a array of 64bit floating point samples.
 
Convert(Int16, Int32) 
Converts a array of signed 16bit integer samples
into a array of 32bit signed integer samples.
 
Convert(Int16, Single) 
Converts a array of signed 16bit integer samples
into a array of 32bit floating point samples.
 
Convert(Int16, Byte) 
Converts a matrix of signed 16bit integer samples
into a matrix of 8bit unsigned byte samples.
 
Convert(Int16, Double) 
Converts a matrix of signed 16bit integer samples
into a matrix of 64bit floating point samples.
 
Convert(Int16, Int32) 
Converts a matrix of signed 16bit integer samples
into a matrix of 32bit signed integer samples.
 
Convert(Int16, Single) 
Converts a matrix of signed 16bit integer samples
into a matrix of 32bit floating point samples.
 
Convert(Int32, Byte) 
Converts a signed 32bit integer sample
into a 8bit unsigned byte sample.
 
Convert(Int32, Int16) 
Converts a signed 32bit integer sample
into a 16bit signed integer sample.
 
Convert(Int32, Int32) 
Converts a signed 32bit integer sample
into a 32bit floating point sample.
 
Convert(Int32, Single) 
Converts a signed 32bit integer sample
into a 32bit floatpoint sample.
 
Convert(Int32, Byte) 
Converts a array of signed 32bit integer samples
into a array of 8bit unsigned byte samples.
 
Convert(Int32, Int16) 
Converts a array of signed 32bit integer samples
into a array of 16bit signed integer samples.
 
Convert(Int32, Int32) 
Converts a array of signed 32bit integer samples
into a array of 32bit floating point samples.
 
Convert(Int32, Single) 
Converts a array of signed 32bit integer samples
into a array of 32bit floatpoint samples.
 
Convert(Int32, Byte) 
Converts a matrix of signed 32bit integer samples
into a matrix of 8bit unsigned byte samples.
 
Convert(Int32, Int16) 
Converts a matrix of signed 32bit integer samples
into a matrix of 16bit signed integer samples.
 
Convert(Int32, Single) 
Converts a matrix of signed 32bit integer samples
into a matrix of 32bit floatpoint samples.
 
Convert(Single, Byte) 
Converts a signed 32bit float sample
into a 8bit unsigned byte sample.
 
Convert(Single, Int16) 
Converts a 32bit float sample
into a 16bit integer sample.
 
Convert(Single, Byte) 
Converts a array of signed 32bit float samples
into a array of 8bit unsigned byte samples.
 
Convert(Single, Int16) 
Converts a array of 32bit float samples
into a array of 16bit integer samples.
 
Convert(Single, Byte) 
Converts a matrix of signed 32bit float samples
into a matrix of 8bit unsigned byte samples.
 
Convert(Single, Int16) 
Converts a matrix of 32bit float samples
into a matrix of 16bit integer samples.
 
Convert(Single, Int32) 
Converts a matrix of signed 32bit integer samples
into a matrix of 32bit floating point samples.

Code is mainly based on information available on the original C source code pa_converters.c from Portable Audio I/O Library.
This class try to be as fast as possible without using unsafe code.
Dither isn't currently supported. Currently supported conversions are 'to' and 'from' conversions between the following most common PCM format:
// Suppose we have a collection of samples in PCM16 format // and wish to convert it into IEEE32 floating point format: int[] pcm16Samples = new int [3] { 1, 2, 3 }; // source float[] floatSamples = new float[3]; // target // Call convert passing the source samples. Converted // IEEE samples in will be stored in the target array. SampleConverter.Convert(pcm16samples, floatSamples);