示例#1
0
文件: WAV.cs 项目: jaron780/TagTool
        private void InitWAVFile(byte[] data, int channels, int sampleRate)
        {
            HeaderSize = 0x2C;

            Data = new DataChunk(data);
            FMT  = new WAVFMTChunk(channels, sampleRate);
            RIFF = new RIFFChunk(data.Length, Data.ChunkSize + FMT.ChunkSize);

            if (Data.ChunkSize + FMT.ChunkSize + RIFF.ChunkSize == HeaderSize)
            {
                isValid = true;
            }
            TotalSize = HeaderSize + Data.GetDataLength();
        }
示例#2
0
文件: XMA.cs 项目: jaron780/TagTool
        private void InitXMAFile(byte[] data, int channels, int sampleRate)
        {
            // More like min header size in this case
            HeaderSize = 0x3C;

            Data = new DataChunk(data);
            FMT  = new XMAFMTChunk(channels, sampleRate);
            RIFF = new RIFFChunk(data.Length, Data.ChunkSize + FMT.ChunkSize);

            RealHeaderSize = Data.ChunkSize + FMT.ChunkSize + RIFF.ChunkSize;
            TotalSize      = RealHeaderSize + Data.GetDataLength();

            // Not a solid verification but whatever
            if (RealHeaderSize >= HeaderSize)
            {
                isValid = true;
            }
        }