/// <summary> /// Creates a new seekpoint. /// </summary> /// <param name="data"></param> public SeekPoint(byte[] data) { this.firstSampleNumber = BinaryDataHelper.GetUInt64(data, 0); this.byteOffset = BinaryDataHelper.GetUInt64(data, 8); this.numberOfSamples = BinaryDataHelper.GetUInt16(data, 16); ValidateIsPlaceholder(); }
/// <summary> /// Loads a new stream info block from the provided data. /// </summary> /// <param name="data"></param> public override void LoadBlockData(byte[] data) { // "All numbers are big-endian coded and unsigned". // 1: Minimum Block Size (first 16-bit) this.minimumBlockSize = BinaryDataHelper.GetUInt16(data, 0); this.maximumBlockSize = BinaryDataHelper.GetUInt16(data, 2); this.minimumFrameSize = BinaryDataHelper.GetUInt24(data, 4); this.maximumFrameSize = BinaryDataHelper.GetUInt24(data, 7); // Interpret 20 bits starting from byte 10 as a UInt this.sampleRateHz = (UInt32)BinaryDataHelper.GetUInt64(data, 10, 20); this.channels = (short)(BinaryDataHelper.GetUInt64(data, 12, 3, 4) + 1); this.bitsPerSample = (short)(BinaryDataHelper.GetUInt64(data, 12, 5, 7) + 1); this.samples = (long)BinaryDataHelper.GetUInt64(data, 13, 36, 4); this.md5Signature = new byte[16]; Array.Copy(data, 18, this.md5Signature, 0, 16); }