function TestSource (options) {

    this._src = _context.createBufferSource();
    this._out = _context.createGain();
    this._panner = _context.createPanner();
    this._analyser = _context.createAnalyser();

    this._src.connect(this._out);
    this._out.connect(this._analyser);
    this._analyser.connect(this._panner);
    this._panner.connect(_context.destination);
    
    this._src.buffer = options.buffer;
    this._src.loop = true;
    this._out.gain.value = options.gain;

    this._analyser.fftSize = 1024;
    this._analyser.smoothingTimeConstant = 0.85;
    this._lastRMSdB = 0.0;

    this._panner.panningModel = _PANNING_MODEL;
    this._panner.distanceModel = _DISTANCE_MODEL;
    this._panner.coneInnerAngle = _CONE_INNER_ANGLE;
    this._panner.coneOuterAngle = _CONE_OUTER_ANGLE;
    this._panner.coneOuterGain = _CONE_OUTER_GAIN;

    this._position = [0, 0, 0];
    this._orientation = [1, 0, 0];

    this._analyserBuffer = new Uint8Array(this._analyser.fftSize);

    if (!_LEGACY_WEBAUDIO) {
      this._src.detune.value = (options.detune || 0);
      this._analyserBuffer = new Float32Array(this._analyser.fftSize);
    }

    this.setPosition(options.position);
    this.setOrientation(options.orientation);

  }
/**
   * A buffer source player with HRTF panning for testing purpose.
   * @param {Object} options Default options.
   * @param {Number} options.gain Sound object gain. (0.0~1.0)
   * @param {Number} options.buffer AudioBuffer to play.
   * @param {Number} options.detune Detune parameter. (cent)
   * @param {Array} options.position x, y, z position in a array.
   */
A buffer source player with HRTF panning for testing purpose.
@param {Object} options Default options.
@param {Number} options.gain Sound object gain.
A buffer source player with HRTF panning for testing purpose . @param { Object } options Default options . @param { Number } options . gain Sound object gain .
function TestSource (options) {
    this._src = _context.createBufferSource();
    this._out = _context.createGain();
    this._panner = _context.createPanner();
    this._analyser = _context.createAnalyser();
    this._src.connect(this._out);
    this._out.connect(this._analyser);
    this._analyser.connect(this._panner);
    this._panner.connect(_context.destination);
    this._src.buffer = options.buffer;
    this._src.loop = true;
    this._out.gain.value = options.gain;
    this._analyser.fftSize = 1024;
    this._analyser.smoothingTimeConstant = 0.85;
    this._lastRMSdB = 0.0;
    this._panner.panningModel = _PANNING_MODEL;
    this._panner.distanceModel = _DISTANCE_MODEL;
    this._panner.coneInnerAngle = _CONE_INNER_ANGLE;
    this._panner.coneOuterAngle = _CONE_OUTER_ANGLE;
    this._panner.coneOuterGain = _CONE_OUTER_GAIN;
    this._position = [0, 0, 0];
    this._orientation = [1, 0, 0];
    this._analyserBuffer = new Uint8Array(this._analyser.fftSize);
    if (!_LEGACY_WEBAUDIO) {
      this._src.detune.value = (options.detune || 0);
      this._analyserBuffer = new Float32Array(this._analyser.fftSize);
    }
    this.setPosition(options.position);
    this.setOrientation(options.orientation);
  }
function TestSource ( options ) { this . _src = _context . createBufferSource ( ) ; this . _out = _context . createGain ( ) ; this . _panner = _context . createPanner ( ) ; this . _analyser = _context . createAnalyser ( ) ; this . _src . connect ( this . _out ) ; this . _out . connect ( this . _analyser ) ; this . _analyser . connect ( this . _panner ) ; this . _panner . connect ( _context . destination ) ; this . _src . buffer = options . buffer ; this . _src . loop = true ; this . _out . gain . value = options . gain ; this . _analyser . fftSize = 1024 ; this . _analyser . smoothingTimeConstant = 0.85 ; this . _lastRMSdB = 0.0 ; this . _panner . panningModel = _PANNING_MODEL ; this . _panner . distanceModel = _DISTANCE_MODEL ; this . _panner . coneInnerAngle = _CONE_INNER_ANGLE ; this . _panner . coneOuterAngle = _CONE_OUTER_ANGLE ; this . _panner . coneOuterGain = _CONE_OUTER_GAIN ; this . _position = [ 0 , 0 , 0 ] ; this . _orientation = [ 1 , 0 , 0 ] ; this . _analyserBuffer = new Uint8Array ( this . _analyser . fftSize ) ; if ( ! _LEGACY_WEBAUDIO ) { this . _src . detune . value = ( options . detune || 0 ) ; this . _analyserBuffer = new Float32Array ( this . _analyser . fftSize ) ; } this . setPosition ( options . position ) ; this . setOrientation ( options . orientation ) ; }
A buffer source player with HRTF panning for testing purpose.
A buffer source player with HRTF panning for testing purpose .