Esempio n. 1
0
        public bool Set(
            int numChannels,
            int bitsPerSample,
            int validBitsPerSample,
            int sampleRate,
            PcmDataLib.PcmData.ValueRepresentationType sampleValueRepresentation,
            long numFrames,
            byte[] sampleArray)
        {
            mRcd = new RiffChunkDescriptor();

            if (0xffffffffL < sampleArray.LongLength + 36)
            {
                System.Diagnostics.Debug.Assert(false);
                return(false);
            }
            mRcd.Create((uint)(36 + sampleArray.LongLength));

            mFsc = new FmtSubChunk();
            mFsc.Create(numChannels, sampleRate, bitsPerSample, validBitsPerSample, sampleValueRepresentation);

            var dsc = new WavDataSubChunk();

            dsc.Create(numFrames, sampleArray);
            mDscList.Clear();
            mDscList.Add(dsc);
            return(true);
        }
Esempio n. 2
0
        public bool Set(
            int numChannels,
            int bitsPerSample,
            int validBitsPerSample,
            int sampleRate,
            PcmDataLib.PcmData.ValueRepresentationType sampleValueRepresentation,
            long numFrames,
            byte[] sampleArray)
        {
            mRcd = new RiffChunkDescriptor();

            if (0xffffffffL < sampleArray.LongLength + 36) {
                System.Diagnostics.Debug.Assert(false);
                return false;
            }
            mRcd.Create((uint)(36 + sampleArray.LongLength));

            mFsc = new FmtSubChunk();
            mFsc.Create(numChannels, sampleRate, bitsPerSample, validBitsPerSample, sampleValueRepresentation);

            var dsc = new WavDataSubChunk();
            dsc.Create(numFrames, sampleArray);
            mDscList.Clear();
            mDscList.Add(dsc);
            return true;
        }