I have two recordings of same event, different lengths, started at different times. I want to synchronize them, time offset is known. I want to achieve the following:
Here is a way to write silence by millisecond using NAudio:
public static void WriteSilence(WaveFormat waveFormat,
int silenceMilliSecondLength, WaveFileWriter waveFileWriter)
{
int bytesPerMillisecond = waveFormat.AverageBytesPerSecond / 1000;
//an new all zero byte array will play silence
var silentBytes = new byte[silenceMilliSecondLength * bytesPerMillisecond];
waveFileWriter.Write(silentBytes, 0, silentBytes.Length);
waveFileWriter.Dispose();
}