public void Read(BinaryReader reader) { if (Shared.Swap(reader.ReadUInt32()) != smplId) { throw new Exception("Wrong chunk ID!"); } smplSize = reader.ReadUInt32(); manufacturer = reader.ReadUInt32(); product = reader.ReadUInt32(); samplePeriod = reader.ReadUInt32(); unityNote = reader.ReadUInt32(); pitchFraction = reader.ReadUInt32(); smpteFormat = reader.ReadUInt32(); smpteOffset = reader.ReadUInt32(); numLoops = reader.ReadUInt32(); samplerData = reader.ReadUInt32(); for (int i = 0; i < numLoops; i++) { WaveSmplLoop tempLoop = new WaveSmplLoop(); tempLoop.Read(reader); smplLoops.Add(tempLoop); } }
public void AddLoop(int loopStartSample, int loopEndSample) { RemoveAllLoops(); numLoops++; WaveSmplLoop tmpLoop = new WaveSmplLoop(); tmpLoop.LoopStart = (uint)loopStartSample; tmpLoop.LoopEnd = (uint)loopEndSample; smplLoops.Add(tmpLoop); }
public void Read(BinaryReader reader) { if (Shared.Swap(reader.ReadUInt32()) != smplId) throw new Exception("Wrong chunk ID!"); smplSize = reader.ReadUInt32(); manufacturer = reader.ReadUInt32(); product = reader.ReadUInt32(); samplePeriod = reader.ReadUInt32(); unityNote = reader.ReadUInt32(); pitchFraction = reader.ReadUInt32(); smpteFormat = reader.ReadUInt32(); smpteOffset = reader.ReadUInt32(); numLoops = reader.ReadUInt32(); samplerData = reader.ReadUInt32(); for (int i = 0; i < numLoops; i++) { WaveSmplLoop tempLoop = new WaveSmplLoop(); tempLoop.Read(reader); smplLoops.Add(tempLoop); } }