コード例 #1
0
        public WaveformData(FormatWaweform aFormat, ByteArray aByteArray, string aName, int aPosition)
        {
            format   = aFormat;
            name     = aName;
            position = aPosition;

            bufferLength = format.samples;

            sampleArray     = new float[format.channels][];
            sampleDataArray = new Int32[format.channels][];

            startPosition = 0x7FFFFFFF;
        }
コード例 #2
0
        public WaveformSfbk(RiffChunkListSdta[] sdtaBodyList, ShdrData shdrData, int startAddrsOffset, int endAddrsOffset, string aName)
            : base()
        {
            string name     = aName;
            int    position = ( int )sdtaBodyList[0].smplBody.position + ( int )(shdrData.start + startAddrsOffset) * 2;
            int    length   = ( int )((shdrData.end + endAddrsOffset) - (shdrData.start + startAddrsOffset)) * 2;

            int channels   = 1;
            int sampleRate = ( int )shdrData.sampleRate;
            int sampleBits = 16;
            int samples    = length / channels;

            format = new FormatWaweform(channels, samples, sampleRate, sampleBits);
            data   = new WaveformData(format, null, name, position);
        }
コード例 #3
0
        public WaveformWave(RiffFile aRiffFile)
            : base()
        {
            RiffChunkListWave lWaveList = ( RiffChunkListWave )aRiffFile.riffChunkList;

            int lPosition = ( int )lWaveList.dataChunk.position;
            int lLength   = ( int )lWaveList.dataChunk.size;

            int lChannels   = lWaveList.fmt_Chunk.channels;
            int lSampleRate = ( int )lWaveList.fmt_Chunk.samplesPerSec;
            int lSampleBits = lWaveList.fmt_Chunk.bitsPerSample;
            int lSamples    = lLength / (lSampleBits / 8) / lChannels;

            format = new FormatWaweform(lChannels, lSamples, lSampleRate, lSampleBits);
            data   = new WaveformData(format, null, aRiffFile.name, lPosition);
        }
コード例 #4
0
        public WaveformDls(RiffChunkListWave aWaveList, string aName)
            : base()
        {
            RiffChunkFmt_ fmt_Chunk = aWaveList.fmt_Chunk;
            RiffChunkData dataChunk = aWaveList.dataChunk;

            int position = ( int )dataChunk.position;
            int length   = ( int )dataChunk.size;

            int channels   = fmt_Chunk.channles;
            int sampleRate = ( int )fmt_Chunk.samplesPerSec;
            int sampleBits = ( int )fmt_Chunk.bitsPerSample;
            int samples    = length / (sampleBits / 8) / channels;

            format = new FormatWaweform(channels, samples, sampleRate, sampleBits);
            data   = new WaveformData(format, null, aName, position);
        }
コード例 #5
0
        public WaveformAiff(FormFile aFormFile)
            : base()
        {
            FormChunkListAiff aAiffForm = ( FormChunkListAiff )aFormFile.formChunkList;

            FormChunkSsnd lSsndChunk = aAiffForm.chunkSsnd;
            int           lPosition  = ( int )lSsndChunk.position;
            int           lLength    = lSsndChunk.dataSize;

            FormChunkComm lChunkComm  = aAiffForm.chunkComm;
            int           lChannels   = lChunkComm.numberOfChannels;
            int           lSampleRate = ( int )lChunkComm.sampleRate;
            int           lSampleBits = lChunkComm.bitsPerSamples;
            int           lSamples    = lLength / (lSampleBits / 8) / lChannels;

            format = new FormatWaweform(lChannels, lSamples, lSampleRate, lSampleBits);
            data   = new WaveformData(format, null, aFormFile.name, lPosition);
        }