Exemple #1
0
        public FactChunk(MappedFile f, int sampleLength) :
            base(f, "fact")
        {
            dwSampleLength = AddPtr <Int32Ptr>(f);

            SampleLength = sampleLength;
        }
Exemple #2
0
        public FmtChunk(MappedFile f, WaveFormat _audioFormat)
            : base(f, "fmt ")
        {
            // Structure
            wFormatTag      = AddPtr <Int16Ptr>(f);
            nChannels       = AddPtr <Int16Ptr>(f);
            nSamplesPerSec  = AddPtr <Int32Ptr>(f);
            nAvgBytesPerSec = AddPtr <Int32Ptr>(f);
            nBlockAlign     = AddPtr <Int16Ptr>(f);
            wBitsPerSample  = AddPtr <Int16Ptr>(f);
            if (_audioFormat != WaveFormat.PCM)
            {
                cbSize = AddPtr <Int16Ptr>(f);
                if (_audioFormat == WaveFormat.EXTENSIBLE)
                {
                    wValidBitsPerSample = AddPtr <Int16Ptr>(f);
                    dwChannelMask       = AddPtr <Int32Ptr>(f);
                    gidSubFormat        = AddPtr <ByteArrayPtr>(new ByteArrayPtr(f, 16));
                    cbSize = new Int16Ptr(f);
                }
            }

            // Initialization
            FormatTag = _audioFormat;
        }
Exemple #3
0
 public ChunkHeader(MappedFile f, string _id)
 {
     id = new FourCCPtr(f);
     id.Write(_id);
     blen = new Int32Ptr(f);
     blen.Write(0);
     body   = new List <MappedPtr>();
     chunks = new List <ChunkHeader>();
 }