public WaveFileWriter(int sampleRate, int channels, int bitsPerSample, IResource tempFile, IResource waveFile)
{
this.sRate = sampleRate;
this.channels = channels;
this.bits = bitsPerSample;
if (!tempFile.WriteAllowed() || !tempFile.ReadAllowed() || !tempFile.DeleteAllowed())
throw new Exception("A valid temporary file with read/write/and delete access is required.");
tempR = tempFile;
writer = new BinaryWriter(tempR.OpenResourceForWrite());
if (!waveFile.WriteAllowed())
throw new Exception("A valid wave file with write access is required.");
wavR = waveFile;
}
public void Write(byte[] buffer)