static areAudiosCompatible_(a, b, compareCodecs) {
    const AdaptationSet = shaka.media.AdaptationSet;

    // Don't adapt between channel counts, which could annoy the user
    // due to volume changes on downmixing.  An exception is made for
    // stereo and mono, which should be fine to adapt between.
    if (!a.channelsCount || !b.channelsCount ||
        a.channelsCount > 2 || b.channelsCount > 2) {
      if (a.channelsCount != b.channelsCount) {
        return false;
      }
    }

    // Don't adapt between spatial and non spatial audio, which may
    // annoy the user.
    if (a.spatialAudio !== b.spatialAudio) {
      return false;
    }

    // We can only adapt between base-codecs.
    if (compareCodecs && !AdaptationSet.canTransitionBetween_(a, b)) {
      return false;
    }

    // Audio roles must not change between adaptations.
    if (!AdaptationSet.areRolesEqual_(a.roles, b.roles)) {
      return false;
    }

    // We can only adapt between the same groupId.
    if (a.groupId !== b.groupId) {
      return false;
    }

    return true;
  }
Check if we can switch between two audio streams.

@param {shaka.extern.Stream} a
@param {shaka.extern.Stream} b
@param {boolean} compareCodecs
@return {boolean}
@private