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

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

Parameters

format
Type: SystemIntPtr
input audio format
data
Type: SystemByte
input audio data
formatPcm
Type: SystemIntPtr
output audio format
dataPcm
Type: SystemByte
output audio data
Examples
This example shows simple using of ToPcm 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