function generateExpectedBusFromTOAIRBuffer(buffer) {
    // TOA IR set is 16 channels.
    expect(buffer.numberOfChannels).to.equal(16);

    // Derive ambisonic order from number of channels.
    var ambisonicOrder = Math.floor(Math.sqrt(buffer.numberOfChannels)) - 1;

    // Get pointers to each buffer.
    var acnChannelData = [];
    for (var i = 0; i < buffer.numberOfChannels; i++)
      acnChannelData[i] = buffer.getChannelData(i);

    var generatedBus = new AudioBus(2, buffer.length, buffer.sampleRate);
    var L = generatedBus.getChannelData(0);
    var R = generatedBus.getChannelData(1);

    // We wish to exploit front-axis symmetry, hence the left output will be
    // the sum of all spherical harmonics while the right output is the
    // difference between the positive-m spherical harmonics and the negative-m
    // spherical harmonics.
    for (var i = 0; i < buffer.length; ++i) {
      L[i] = 0;
      R[i] = 0;
      for (var l = 0; l <= ambisonicOrder; l++) {
        for (var m = -l; m <= l; m++) {
          var channelValue = acnChannelData[l * l + l + m];
          L[i] += channelValue;
          R[i] += m >= 0 ? channelValue : -channelValue;
        }
      }
    }

    return generatedBus;
  }
Generate the expected binaural rendering (based on SH-maxRE algorithm)
result from the impulse response and generate an AudioBus instance.
@param  {AudioBuffer} buffer     TOA SH-maxRE HRIR buffer.
@return {AudioBus}