Esempio n. 1
0
        public AmpFileSample ReadSample()
        {
            AmpFileSample sample = null;

            try
            {
                sample = ReadHeader();
                if (sample != null)
                {
                    sample.Buffer = reader.ReadBytes(sample.BufferSize);
                }
            }
            catch (EndOfStreamException)
            {
            }

            return(sample);
        }
Esempio n. 2
0
        private AmpFileSample ReadHeader()
        {
            if (reader.BaseStream.Position >= reader.BaseStream.Length)
            {
                return(null);
            }

            AmpFileSample sample = new AmpFileSample();

            sample.FilePosition = reader.BaseStream.Position;

            sample.SampleType  = reader.ReadInt32();
            sample.SampleFlags = reader.ReadInt32();
            sample.StartTime   = reader.ReadUInt64();
            sample.StopTime    = reader.ReadUInt64();
            sample.BufferSize  = reader.ReadInt32();

            return(sample);
        }