-
Notifications
You must be signed in to change notification settings - Fork 1
/
stereo-panner-node.min.js
13 lines (11 loc) · 3.75 KB
/
stereo-panner-node.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.StereoPannerNode = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
function StereoPannerNode(e,n){n=n||{};var t=e.createChannelSplitter(2),a=e.createWaveShaper(),o=e.createGain(),r=e.createWaveShaper(),c=e.createWaveShaper(),i=e.createGain(),l=e.createGain(),u=e.createChannelMerger(2),d="number"==typeof n.pan?n.pan:0;return t.channelCount=2,t.channelCountMode="explicit",t.channelInterpretation="speakers",t.connect(i,0),t.connect(l,1),t.connect(a,1),a.channelCount=1,a.channelCountMode="explicit",a.channelInterpretation="discrete",a.curve=curveDC,a.connect(o),o.channelCount=1,o.ChannelMergerNode="explicit",o.channelInterpretation="discrete",o.gain.value=d,o.connect(r),o.connect(c),r.channelCount=1,r.channelCountMode="explicit",r.channelInterpretation="discrete",r.curve=curveL,r.connect(i.gain),c.channelCount=1,c.channelCountMode="explicit",c.channelInterpretation="discrete",c.curve=curveR,c.connect(l.gain),i.channelCount=1,i.channelCountMode="explicit",i.channelInterpretation="discrete",i.gain.value=0,i.connect(u,0,0),l.channelCount=1,l.channelCountMode="explicit",l.channelInterpretation="discrete",l.gain.value=0,l.connect(u,0,1),u.channelCount=1,u.channelCountMode="explicit",u.channelInterpretation="discrete",Object.defineProperties(t,{pan:{value:o.gain,enumerable:!0,writable:!1,configurable:!0},connect:{value:AudioNode.prototype.connect.bind(u),enumerable:!1,writable:!1,configurable:!0},disconnect:{value:AudioNode.prototype.disconnect.bind(u),enumerable:!1,writable:!1,configurable:!0}}),t}for(var BaseAudioContext=require("base-audio-context"),WS_CURVE_SIZE=4096,curveL=new Float32Array(WS_CURVE_SIZE),curveR=new Float32Array(WS_CURVE_SIZE),curveDC=new Float32Array([1,1]),i=0;i<WS_CURVE_SIZE;i++)curveL[i]=Math.cos(i/WS_CURVE_SIZE*Math.PI*.5),curveR[i]=Math.sin(i/WS_CURVE_SIZE*Math.PI*.5);StereoPannerNode.polyfill=function(){BaseAudioContext&&!BaseAudioContext.prototype.hasOwnProperty("createStereoPanner")&&StereoPannerNode.install()},StereoPannerNode.install=function(){Object.defineProperty(BaseAudioContext.prototype,"createStereoPanner",{value:function(){return new StereoPannerNode(this)},enumerable:!1,writable:!1,configurable:!0})},"function"==typeof Symbol&&"symbol"==typeof Symbol.hasInstance&&Object.defineProperty(StereoPannerNode,Symbol.hasInstance,{value:function(e){return e instanceof AudioNode&&e.pan instanceof AudioParam}}),module.exports=StereoPannerNode;
},{"base-audio-context":2}],2:[function(require,module,exports){
(function (global){
var AudioContext = global.AudioContext || global.webkitAudioContext;
var OfflineAudioContext = global.OfflineAudioContext || global.webkitOfflineAudioContext;
var BaseAudioContext = global.BaseAudioContext || (OfflineAudioContext && Object.getPrototypeOf(OfflineAudioContext));
module.exports = (typeof BaseAudioContext === "function" && BaseAudioContext.prototype) ? BaseAudioContext : AudioContext;
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}]},{},[1])(1)
});