Try
How convert wav pcm 44100 to a-law 8bit mono in c#[
^]
static void PcmToAlaw(string fileName)
{
WaveReader wr = new WaveReader(File.OpenRead(fileName));
IntPtr pcmFormat = wr.ReadFormat();
FormatDetails[] fdArr = AudioCompressionManager.GetCompatibleFormatList(pcmFormat, true);
foreach (FormatDetails fd in fdArr)
{
WaveFormat wf = AudioCompressionManager.GetWaveFormat(fd.FormatHandle);
if (wf.wFormatTag == AudioCompressionManager.ALawFormatTag && wf.nChannels == 1)
{
IntPtr alawFormat = fd.FormatHandle;
byte[] alawData = AudioCompressionManager.ToFormat(wr, alawFormat);
WaveWriter ww = new WaveWriter(File.Create(fileName + ".wav"),
AudioCompressionManager.FormatBytes(alawFormat));
ww.WriteData(alawData);
ww.Close();
break;
}
}
}