예제 #1
0
        public AmpFileSample ReadSample()
        {
            AmpFileSample sample = null;

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

            return(sample);
        }
예제 #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);
        }