SampleConverter Class |
Namespace: Accord.Audio
Name | Description | |
---|---|---|
Convert(Byte, Int16) |
Converts a unsigned 8-bit byte sample
into a 16-bit short integer sample.
| |
Convert(Byte, Int32) |
Converts a unsigned 8-bit byte sample
into a 32-bit integer sample.
| |
Convert(Byte, Single) |
Converts a unsigned 8-bit byte sample
into a 32-bit floating point sample.
| |
Convert(Byte, Int16) |
Converts an array of unsigned 8-bit byte samples
into an array of 16-bit short integer samples.
| |
Convert(Byte, Int32) |
Converts an array of unsigned 8-bit byte samples
into an array of 32-bit integer samples.
| |
Convert(Byte, Single) |
Converts an array of unsigned 8-bit byte samples
into an array of 32-bit floating point samples.
| |
Convert(Byte, Int16) |
Converts a matrix of unsigned 8-bit byte samples
into a array of 16-bit short integer samples.
| |
Convert(Byte, Int32) |
Converts a matrix of unsigned 8-bit byte samples
into a matrix of 32-bit integer samples.
| |
Convert(Byte, Single) |
Converts a matrix of unsigned 8-bit byte samples
into a matrix of 32-bit floating-point samples.
| |
Convert(Int16, Byte) |
Converts a signed 16-bit integer sample
into a 8-bit unsigned byte sample.
| |
Convert(Int16, Double) |
Converts a signed 16-bit integer sample
into a 64-bit floating point sample.
| |
Convert(Int16, Int32) |
Converts a signed 16-bit integer sample
into a 32-bit signed integer sample.
| |
Convert(Int16, Single) |
Converts a signed 16-bit integer sample
into a 32-bit floating point sample.
| |
Convert(Int16, Byte) |
Converts a array of signed 16-bit integer samples
into a array of 8-bit unsigned byte samples.
| |
Convert(Int16, Double) |
Converts a array of signed 16-bit integer samples
into a array of 64-bit floating point samples.
| |
Convert(Int16, Int32) |
Converts a array of signed 16-bit integer samples
into a array of 32-bit signed integer samples.
| |
Convert(Int16, Single) |
Converts a array of signed 16-bit integer samples
into a array of 32-bit floating point samples.
| |
Convert(Int16, Byte) |
Converts a matrix of signed 16-bit integer samples
into a matrix of 8-bit unsigned byte samples.
| |
Convert(Int16, Double) |
Converts a matrix of signed 16-bit integer samples
into a matrix of 64-bit floating point samples.
| |
Convert(Int16, Int32) |
Converts a matrix of signed 16-bit integer samples
into a matrix of 32-bit signed integer samples.
| |
Convert(Int16, Single) |
Converts a matrix of signed 16-bit integer samples
into a matrix of 32-bit floating point samples.
| |
Convert(Int32, Byte) |
Converts a signed 32-bit integer sample
into a 8-bit unsigned byte sample.
| |
Convert(Int32, Int16) |
Converts a signed 32-bit integer sample
into a 16-bit signed integer sample.
| |
Convert(Int32, Int32) |
Converts a signed 32-bit integer sample
into a 32-bit floating point sample.
| |
Convert(Int32, Single) |
Converts a signed 32-bit integer sample
into a 32-bit float-point sample.
| |
Convert(Int32, Byte) |
Converts a array of signed 32-bit integer samples
into a array of 8-bit unsigned byte samples.
| |
Convert(Int32, Int16) |
Converts a array of signed 32-bit integer samples
into a array of 16-bit signed integer samples.
| |
Convert(Int32, Int32) |
Converts a array of signed 32-bit integer samples
into a array of 32-bit floating point samples.
| |
Convert(Int32, Single) |
Converts a array of signed 32-bit integer samples
into a array of 32-bit float-point samples.
| |
Convert(Int32, Byte) |
Converts a matrix of signed 32-bit integer samples
into a matrix of 8-bit unsigned byte samples.
| |
Convert(Int32, Int16) |
Converts a matrix of signed 32-bit integer samples
into a matrix of 16-bit signed integer samples.
| |
Convert(Int32, Single) |
Converts a matrix of signed 32-bit integer samples
into a matrix of 32-bit float-point samples.
| |
Convert(Single, Byte) |
Converts a signed 32-bit float sample
into a 8-bit unsigned byte sample.
| |
Convert(Single, Int16) |
Converts a 32-bit float sample
into a 16-bit integer sample.
| |
Convert(Single, Byte) |
Converts a array of signed 32-bit float samples
into a array of 8-bit unsigned byte samples.
| |
Convert(Single, Int16) |
Converts a array of 32-bit float samples
into a array of 16-bit integer samples.
| |
Convert(Single, Byte) |
Converts a matrix of signed 32-bit float samples
into a matrix of 8-bit unsigned byte samples.
| |
Convert(Single, Int16) |
Converts a matrix of 32-bit float samples
into a matrix of 16-bit integer samples.
| |
Convert(Single, Int32) |
Converts a matrix of signed 32-bit integer samples
into a matrix of 32-bit 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 PCM-16 format // and wish to convert it into IEEE-32 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);