static parseHeader(data, offset) {
    const MpegAudio = shaka.transmuxer.MpegAudio;

    const mpegVersion = (data[offset + 1] >> 3) & 3;
    const mpegLayer = (data[offset + 1] >> 1) & 3;
    const bitRateIndex = (data[offset + 2] >> 4) & 15;
    const sampleRateIndex = (data[offset + 2] >> 2) & 3;
    if (mpegVersion !== 1 && bitRateIndex !== 0 &&
      bitRateIndex !== 15 && sampleRateIndex !== 3) {
      const paddingBit = (data[offset + 2] >> 1) & 1;
      const channelMode = data[offset + 3] >> 6;
      let columnInBitrates = 0;
      if (mpegVersion === 3) {
        columnInBitrates = 3 - mpegLayer;
      } else {
        columnInBitrates = mpegLayer === 3 ? 3 : 4;
      }
      const bitRate = MpegAudio.BITRATES_MAP_[
          columnInBitrates * 14 + bitRateIndex - 1] * 1000;
      const columnInSampleRates =
        mpegVersion === 3 ? 0 : mpegVersion === 2 ? 1 : 2;
      const sampleRate = MpegAudio.SAMPLING_RATE_MAP_[
          columnInSampleRates * 3 + sampleRateIndex];
      // If bits of channel mode are `11` then it is a single channel (Mono)
      const channelCount = channelMode === 3 ? 1 : 2;
      const sampleCoefficient =
          MpegAudio.SAMPLES_COEFFICIENTS_[mpegVersion][mpegLayer];
      const bytesInSlot = MpegAudio.BYTES_IN_SLOT_[mpegLayer];
      const samplesPerFrame = sampleCoefficient * 8 * bytesInSlot;
      const frameLength =
        Math.floor((sampleCoefficient * bitRate) / sampleRate + paddingBit) *
        bytesInSlot;

      const userAgent = navigator.userAgent || '';
      // This affect to Tizen also for example.
      const result = userAgent.match(/Chrome\/(\d+)/i);
      const chromeVersion = result ? parseInt(result[1], 10) : 0;
      const needChromeFix = !!chromeVersion && chromeVersion <= 87;

      if (needChromeFix && mpegLayer === 2 &&
        bitRate >= 224000 && channelMode === 0) {
        // Work around bug in Chromium by setting channelMode
        // to dual-channel (01) instead of stereo (00)
        data[offset + 3] = data[offset + 3] | 0x80;
      }

      return {sampleRate, channelCount, frameLength, samplesPerFrame};
    }
    return null;
  }
@param {!Uint8Array} data
@param {!number} offset
@return {?{sampleRate: number, channelCount: number,
frameLength: number, samplesPerFrame: number}}