Esempio n. 1
0
        public RiffDls_Wsmp(string aId, UInt32 aSize, AByteArray aByteArray, RiffChunkList aParent)
            : base(aId, aSize, aByteArray, aParent)
        {
            lsize       = aByteArray.ReadUInt32();
            unityNote   = aByteArray.ReadUInt16();
            fineTune    = aByteArray.ReadInt16();
            attenuation = aByteArray.ReadInt32();
            options     = aByteArray.ReadUInt32();
            sampleLoops = aByteArray.ReadUInt32();

            informationList.Add("Size:" + lsize);
            informationList.Add("Unity Note:" + unityNote);
            informationList.Add("Fine Tune:" + fineTune);
            informationList.Add("Attenuation:" + attenuation);
            informationList.Add("Options:" + options);
            informationList.Add("Sample Loops:" + sampleLoops);

            waveSampleLoop = new WaveSampleLoop[sampleLoops];

            for (int i = 0; i < sampleLoops; i++)
            {
                informationList.Add("Wave Sample Loop:");

                waveSampleLoop[i] = new WaveSampleLoop(aByteArray, informationList);
            }
        }
Esempio n. 2
0
        private void ReadSampleArray16(AByteArray aByteArray, int aBasePosition)
        {
            aByteArray.SetPosition(aBasePosition);

            for (int i = 0; i < format.samples; i++)
            {
                for (int j = 0; j < format.channels; j++)
                {
                    Int32 lSample = aByteArray.ReadInt16();
                    sampleByteArray[j][i] = ( sbyte )(lSample >> 8);
                }
            }
        }
Esempio n. 3
0
        private void ReadSampleArray16(AByteArray aByteArray, int aPositionSample)
        {
            aByteArray.SetPosition(basePosition + 2 * format.channels * aPositionSample);

            for (int i = 0; i < bufferLength && i < format.samples - aPositionSample; i++)
            {
                for (int j = 0; j < format.channels; j++)
                {
                    Int32 lSample = aByteArray.ReadInt16();
                    sampleArray[j][i] = ( float )lSample / ( float )Int16.MaxValue;
                }
            }
        }