public ISfFileHost ResampleAndMono(ISfFileHost inFile, IScriptableApp appl, uint rate) { inFile.DoResample(rate, 4, EffectOptions.WaitForDoneOrCancel | EffectOptions.EffectOnly); if (inFile.Channels > 1) { double[,] aGainMap = new double[1, 2] { { 0.5, 0.5 } }; inFile.DoConvertChannels(1, 0, aGainMap, EffectOptions.WaitForDoneOrCancel | EffectOptions.EffectOnly); } return inFile; }