Click or drag to resize
AudioCompressionManagerToPcm16Bit Method
Helper for decoding audio data in PCM (Pulse-code modulation) 16 bit.

Namespace: Alvas.Audio
Assembly: Alvas.Audio (in Alvas.Audio.dll) Version: 2016.0.6173.41573
Syntax
public static void ToPcm16Bit(
	IntPtr format,
	byte[] data,
	ref IntPtr formatPcm16Bit,
	ref byte[] dataPcm16Bit
)

Parameters

format
Type: SystemIntPtr
input audio format
data
Type: SystemByte
input audio data
formatPcm16Bit
Type: SystemIntPtr
output audio format
dataPcm16Bit
Type: SystemByte
output audio data
Examples
This example shows simple using of ToPcm16Bit method.
string fileName = @"in.wav";
WaveReader wr = new WaveReader(File.OpenRead(fileName));
IntPtr formatWav = wr.ReadFormat();
byte[] data = wr.ReadData();
wr.Close();
IntPtr formatPcm = IntPtr.Zero;
byte[] dataPcm = null;
AudioCompressionManager.ToPcm(formatWav, data, ref formatPcm, ref dataPcm);
WaveWriter ww = new WaveWriter(File.Create(fileName + ".wav"), AudioCompressionManager.FormatBytes(formatPcm));
ww.WriteData(dataPcm);
ww.Close();
See Also