TargetFormat = ImaAdpcmWaveFormat.MyImaAdpcmWaveFormat(8000, 1, 4, 505)
convertedStream = New WaveFormatConversionStream(TargetFormat, Reader)
WaveFileWriter.CreateWaveFile(CurrentFile, convertedStream)
MyImaAdpcmWaveFormat class:
public static ImaAdpcmWaveFormat MyImaAdpcmWaveFormat(int sampleRate, int channels, int bitsPerSample, float samplesperblock)
{
ImaAdpcmWaveFormat ImaAdpcmWformat = new ImaAdpcmWaveFormat();
ImaAdpcmWformat.waveFormatTag = WaveFormatEncoding.ImaAdpcm; //
ImaAdpcmWformat.sampleRate = sampleRate;
ImaAdpcmWformat.channels = (short)channels;
ImaAdpcmWformat.bitsPerSample = (short)bitsPerSample; // TODO: can be 3 or 4
ImaAdpcmWformat.extraSize = 2;//
ImaAdpcmWformat.blockAlign = 256; //TODO
ImaAdpcmWformat.averageBytesPerSecond = 4055; //TODO
ImaAdpcmWformat.samplesPerBlock = (short)samplesperblock; // TODO
return ImaAdpcmWformat;
}