/// <summary> /// Export an audio file to be played back channel after channel. /// </summary> /// <param name="path">Output file name</param> /// <param name="data">Samples to write in the file</param> /// <param name="channelCount">Output channel count</param> /// <param name="sampleRate">Output sample rate</param> /// <param name="bits">Output bit depth</param> public static void WriteForEachChannel(string path, float[] data, int channelCount, int sampleRate, BitDepth bits) { RIFFWaveWriter writer = new RIFFWaveWriter(path, channelCount, data.LongLength / channelCount, sampleRate, bits); writer.WriteForEachChannel(data, channelCount); writer.Dispose(); }
/// <summary> /// Export an audio file to be played back channel after channel. /// </summary> /// <param name="path">Output file name</param> /// <param name="data">Samples to write in the file</param> /// <param name="sampleRate">Output sample rate</param> /// <param name="bits">Output bit depth</param> /// <param name="period">Channels separated by this many channels are played simultaneously</param> public static void WriteOffset(string path, float[][] data, int sampleRate, BitDepth bits, int period = -1) { RIFFWaveWriter writer = new RIFFWaveWriter(path, data.Length, data[0].LongLength, sampleRate, bits); writer.WriteOffset(data, period); writer.Dispose(); }