public void setWave(WavFile wave) { if (!wave.checkFormat(wf)) { throw new Exception("Wrong import wave format"); } byte[] bts = wave.rawBytes(); if (bts.Length != wavelen()) { throw new Exception("Bad import wave length"); } UInt32 bpos = 0; foreach (UInt32[] x in waveMap) { byte[] chunk = new byte[x[1]]; Array.Copy(bts, bpos, chunk, 0, x[1]); bpos += x[1]; data.Position = x[0]; data.Write(chunk, 0, (int)x[1]); } }
public void setWave(WavFile wave) { if (!wave.checkFormat(wf)) throw new Exception("Wrong import wave format"); byte[] bts=wave.rawBytes(); if (bts.Length != wavelen()) throw new Exception("Bad import wave length"); UInt32 bpos=0; foreach (UInt32[] x in waveMap) { byte[] chunk = new byte[x[1]]; Array.Copy(bts, bpos, chunk, 0, x[1]); bpos += x[1]; data.Position = x[0]; data.Write(chunk, 0, (int)x[1]); } }