Exemple #1
0
        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);
            }
        }
Exemple #2
0
        public void AddLoop(int loopStartSample, int loopEndSample)
        {
            RemoveAllLoops();
            numLoops++;

            WaveSmplLoop tmpLoop = new WaveSmplLoop();

            tmpLoop.LoopStart = (uint)loopStartSample;
            tmpLoop.LoopEnd   = (uint)loopEndSample;

            smplLoops.Add(tmpLoop);
        }
Exemple #3
0
        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);
            }
        }
Exemple #4
0
        public void AddLoop(int loopStartSample, int loopEndSample)
        {
            RemoveAllLoops();
            numLoops++;

            WaveSmplLoop tmpLoop = new WaveSmplLoop();
            tmpLoop.LoopStart = (uint)loopStartSample;
            tmpLoop.LoopEnd = (uint)loopEndSample;

            smplLoops.Add(tmpLoop);
        }