code: function Bformat_encoder(audioCtx)
  {
      this.initialized = false;
      
      this.ctx = audioCtx;
      this.azi = 0;
      this.elev = 0;
      this.gainNodes = new Array(4);
      this.in = this.ctx.createGain();
  //    this.in.channelCountMode = 'explicit';
  //    this.in.channelCount = 1;
      this.out = this.ctx.createChannelMerger(4);
      // initialize gains to front direction
      this.gains = [Math.SQRT1_2, 1, 0, 0];
      for (var i=0; i<4; i++) {
          this.gainNodes[i] = this.ctx.createGain();
  //        this.gainNodes[i].channelCountMode = 'explicit';
  //        this.gainNodes[i].channelCount = 1;
          this.gainNodes[i].gain.value = this.gains[i];
      }
      
      // Create connections
      for (var i=0; i<4; i++) {
          this.in.connect(this.gainNodes[i]);
          this.gainNodes[i].connect(this.out,0,i);
      }
      
      this.initialized = true;
  }
docs: //////////////////// /* B_FORMAT ENCODER ////////////////////