PageSourceSearch

https://halcyon-run-production.up.railway.app/assets/webAudioBaseSubGraph-CQOPTOxj.js

js halcyon-run-production.up.railway.app collected 2026-10-03 12:13:02 UTC 12,389 bytes, 1 lines download raw bytes

1import{n as e}from"./observable.pure-CJ4J1f_C.js";import{t}from"./logger-CuBYPcDK.js";import{t as n}from"./webRequest-CNElM_Yd.js";var r=RegExp(`\\.(\\w{3,4})($|\\?)`),i=100,a=new Float32Array([0,0]),o=null,s=null,c=null;function l(){if(!s){s=new Float32Array(i);let e=1/99,t=e;for(let n=1;n<i;n++)s[n]=Math.exp(-11.512925464970227*(1-t)),t+=e}return s}function u(){if(!c){c=new Float32Array(i);let e=1/i,t=e;for(let n=0;n<i;n++)c[n]=1+Math.log10(t)/Math.log10(i),t+=e}return c}function d(e,t,n){o||=new Float32Array(i);let r;if(e===`linear`)return a[0]=t,a[1]=n,a;if(e===`exponential`)r=l();else if(e===`logarithmic`)r=u();else throw Error(`Unknown ramp shape: ${e}`);let s=Math.sign(n-t),c=Math.abs(n-t);if(s===1)for(let e=0;e<r.length;e++)o[e]=t+c*r[e];else{let e=99;for(let n=0;n<r.length;n++,e--)o[n]=t-c*(1-r[e])}return o}function f(e){return e.replace(/#/gm,`%23`)}function p(e){let{url:r,headers:i}=n._CollectCustomizations(e);return Object.keys(i).length>0&&t.Warn(`WebAudioStreamingSound: Custom request headers cannot be applied to a streaming <audio> element and will be ignored. To use custom headers with audio, switch to a static (non-streaming) sound which fetches the file up-front.`),r}async function m(e){let t=await n.FetchAsync(e);if(!t.ok)throw Error(`HTTP ${t.status} loading '${e}': ${t.statusText}`);return{data:await t.arrayBuffer(),contentType:t.headers.get(`Content-Type`)??``}}var h=1e-6,g=!0,_=class{constructor(e,t){this._rampEndTime=0,this._engine=e,this._param=t,this._targetValue=t.value}get isRamping(){return this._engine.currentTime<this._rampEndTime}get targetValue(){return this._targetValue}set targetValue(e){this.setTargetValue(e)}get value(){return this._param.value}dispose(){this._param=null,this._engine=null}setTargetValue(e,n=null){if(!Number.isFinite(e)){t.Warn(`Attempted to set audio parameter to non-finite value: ${e}`);return}this._param.cancelScheduledValues(0);let r=typeof n?.shape==`string`?n.shape:`linear`,i=this._engine.currentTime;if(r===`none`){this._param.value=this._targetValue=e,this._rampEndTime=i;return}let a=typeof n?.duration==`number`?Math.max(n.duration,this._engine.parameterRampDuration):this._engine.parameterRampDuration;if(this._targetValue=e,(a=Math.max(this._engine.parameterRampDuration,a))<h){this._param.setValueAtTime(e,i);return}try{this._param.setValueCurveAtTime(d(r,Number.isFinite(this._param.value)?this._param.value:0,e),i,a),this._rampEndTime=i+a}catch(e){g&&=(t.Warn(`Audio parameter ramping failed: ${e.message}`),!1)}}},v;(function(e){e[e.HAS_INPUTS=1]=`HAS_INPUTS`,e[e.HAS_OUTPUTS=2]=`HAS_OUTPUTS`,e[e.HAS_INPUTS_AND_OUTPUTS=3]=`HAS_INPUTS_AND_OUTPUTS`})(v||={});var y=class{constructor(t,n){this.onDisposeObservable=new e,this.engine=t,n&1&&(this._upstreamNodes=new Set),n&2&&(this._downstreamNodes=new Set)}dispose(){if(this._downstreamNodes){for(let e of Array.from(this._downstreamNodes))if(!this._disconnect(e))throw Error(`Disconnect failed`);this._downstreamNodes.clear()}if(this._upstreamNodes){for(let e of Array.from(this._upstreamNodes))if(!e._disconnect(this))throw Error(`Disconnect failed`);this._upstreamNodes.clear()}this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear()}_connect(e){return!this._downstreamNodes||this._downstreamNodes.has(e)||!e._onConnect(this)?!1:(this._downstreamNodes.add(e),!0)}_disconnect(e){return!this._downstreamNodes||!this._downstreamNodes.delete(e)?!1:e._onDisconnect(this)}_onConnect(e){return!this._upstreamNodes||this._upstreamNodes.has(e)?!1:(this._upstreamNodes.add(e),!0)}_onDisconnect(e){return this._upstreamNodes?.delete(e)??!1}},b=class extends y{constructor(t,n,r){super(n,r),this.onNameChangedObservable=new e,this._name=t}get name(){return this._name}set name(e){if(this._name===e)return;let t=this._name;this._name=e,this.onNameChangedObservable.notifyObservers({newName:e,oldName:t,node:this})}dispose(){super.dispose(),this.onNameChangedObservable.clear()}},x=class extends b{constructor(e,t){super(e,t,3)}connect(e){if(!this._connect(e))throw Error(`Connect failed`)}disconnect(e){if(!this._disconnect(e))throw Error(`Disconnect failed`)}disconnectAll(){if(!this._downstreamNodes)throw Error(`Disconnect failed`);let e=this._downstreamNodes.values();for(let t=e.next();!t.done;t=e.next())if(!this._disconnect(t.value))throw Error(`Disconnect failed`)}},S={volume:1},C=class extends x{constructor(e){super(`Volume`,e)}setOptions(e){this.setVolume(e.volume??S.volume,{shape:`none`})}};function w(e){return e.getSubNode(`Volume`)}function T(e,t){return w(e)?.[t]??S[t]}var E={fftSize:2048,minDecibels:-100,maxDecibels:-30,smoothing:.8},D,O;function k(e){return e.analyzerEnabled||e.analyzerFFTSize!==void 0||e.analyzerMinDecibels!==void 0||e.analyzerMaxDecibels!==void 0||e.analyzerSmoothing!==void 0}var A=class{get frequencyBinCount(){return this.fftSize/2}getByteTimeDomainData(){return D??=new Uint8Array}getFloatTimeDomainData(){return O??=new Float32Array}},j=class extends x{constructor(e){super(`Analyzer`,e)}
1setOptions(e){this.fftSize=e.analyzerFFTSize??E.fftSize,this.minDecibels=e.analyzerMinDecibels??E.minDecibels,this.maxDecibels=e.analyzerMaxDecibels??E.maxDecibels,this.smoothing=e.analyzerSmoothing??E.smoothing}};function M(e){return e.getSubNode(`Analyzer`)}function N(e,t,n){e.callOnSubNode(`Analyzer`,e=>{e[t]=n})}var P=null,F=null;function I(){return P||=new Uint8Array,P}function L(){return F||=new Float32Array,F}var R=class extends A{constructor(e){super(),this._fftSize=E.fftSize,this._maxDecibels=E.maxDecibels,this._minDecibels=E.minDecibels,this._smoothing=E.smoothing,this._subGraph=e}get fftSize(){return this._fftSize}set fftSize(e){this._fftSize=e,N(this._subGraph,`fftSize`,e)}get isEnabled(){return M(this._subGraph)!==null}get minDecibels(){return this._minDecibels}set minDecibels(e){this._minDecibels=e,N(this._subGraph,`minDecibels`,e)}get maxDecibels(){return this._maxDecibels}set maxDecibels(e){this._maxDecibels=e,N(this._subGraph,`maxDecibels`,e)}get smoothing(){return this._smoothing}set smoothing(e){this._smoothing=e,N(this._subGraph,`smoothing`,e)}dispose(){let e=M(this._subGraph);e&&(this._subGraph.removeSubNodeAsync(e),e.dispose())}async enableAsync(){M(this._subGraph)||await this._subGraph.createAndAddSubNodeAsync(`Analyzer`)}getByteFrequencyData(){let e=M(this._subGraph);return e?e.getByteFrequencyData():(t.Warn(`AudioAnalyzer not enabled`),this.enableAsync(),I())}getByteTimeDomainData(){let e=M(this._subGraph);return e?e.getByteTimeDomainData():(t.Warn(`AudioAnalyzer not enabled`),this.enableAsync(),super.getByteTimeDomainData())}getFloatFrequencyData(){let e=M(this._subGraph);return e?e.getFloatFrequencyData():(t.Warn(`AudioAnalyzer not enabled`),this.enableAsync(),L())}getFloatTimeDomainData(){let e=M(this._subGraph);return e?e.getFloatTimeDomainData():(t.Warn(`AudioAnalyzer not enabled`),this.enableAsync(),super.getFloatTimeDomainData())}},z=class extends b{constructor(e,t,n){super(e,t,n),this._analyzer=null}get analyzer(){return this._analyzer??=new R(this._subGraph)}get volume(){return T(this._subGraph,`volume`)}set volume(e){let t=w(this._subGraph);if(!t)throw Error(`No volume subnode`);t.volume=e}dispose(){super.dispose(),this._analyzer?.dispose(),this._analyzer=null,this._subGraph.dispose()}setVolume(e,t=null){let n=w(this._subGraph);if(!n)throw Error(`No volume subnode`);n.setVolume(e,t)}},B=class{constructor(){this._createSubNodePromises={},this._isDisposed=!1,this._subNodes={},this._onSubNodeDisposed=e=>{let t=e;delete this._subNodes[t.name],this._onSubNodesChanged()}}callOnSubNode(e,t){let n=this.getSubNode(e);if(n){t(n);return}this._createSubNodePromisesResolvedAsync().then(()=>{let n=this.getSubNode(e);if(n){t(n);return}this.createAndAddSubNodeAsync(e).then(e=>{t(e)})})}createAndAddSubNodeAsync(e){var t;return(t=this._createSubNodePromises)[e]||(t[e]=this._createSubNode(e).then(e=>(this._addSubNode(e),e))),this._createSubNodePromises[e]}dispose(){this._isDisposed=!0;let e=Object.values(this._subNodes);for(let t of e)t.dispose();this._subNodes={},this._createSubNodePromises={}}getSubNode(e){return this._subNodes[e]??null}async removeSubNodeAsync(e){if(!e)return;await this._createSubNodePromisesResolvedAsync();let t=e.name;this._subNodes[t]&&delete this._subNodes[t],delete this._createSubNodePromises[t],this._onSubNodesChanged()}async _createSubNodePromisesResolvedAsync(){return await Promise.all(Object.values(this._createSubNodePromises))}_addSubNode(e){if(this._isDisposed){e.dispose();return}this._subNodes[e.name]=e,e.onDisposeObservable.addOnce(this._onSubNodeDisposed),this._onSubNodesChanged()}};async function V(e){return new H(e)}var H=class extends C{constructor(e){super(e);let t=this.node=new GainNode(e._audioContext);this._volume=new _(e,t.gain)}dispose(){super.dispose(),this._volume.dispose()}get volume(){return this._volume.value}set volume(e){this.setVolume(e)}get _inNode(){return this.node}get _outNode(){return this.node}setVolume(e,t=null){this._volume.setTargetValue(e,t)}_connect(e){return super._connect(e)?(e._inNode&&this.node.connect(e._inNode),!0):!1}_disconnect(e){return super._disconnect(e)?(e._inNode&&this.node.disconnect(e._inNode),!0):!1}getClassName(){return`_VolumeWebAudioSubNode`}};async function U(e){return new W(e)}var W=class extends j{constructor(e){super(e),this._byteFrequencyData=null,this._byteTimeDomainData=null,this._floatFrequencyData=null,this._floatTimeDomainData=null,this._analyzerNode=new AnalyserNode(e._audioContext)}get fftSize(){return this._analyzerNode.fftSize}set fftSize(e){e!==this._analyzerNode.fftSize&&(this._analyzerNode.fftSize=e,this._clearArrays())}get _inNode(){return this._analyzerNode}get minDecibels(){return this._analyzerNode.minDecibels}set minDecibels(e){this._analyzerNode.minDecibels=e}get maxDecibels(){return this._analyzerNode.maxDecibels}set maxDecibels(e){this._analyzerNode.maxDecibels=e}get smoothing(){return this._analyzerNode.smoothingTimeConstant}set smoothing(e){this._analyzerNode.smoothingTimeConstant=e}dispose(){super.dispose(),this._clearArrays(),this._analyzerNode.disconnect()}getClassName(){return`_WebAudioAnalyzerSubNode`}getByteFrequencyData(){return(!this._byteFrequencyData||this._byteFrequencyData.length===0)&&(this._byteFrequencyData=new Uint8Array(this._analyzerNode.frequencyBinCount)),this._analyzerNode.getByteFrequencyData(this._byteFrequencyData),this._byteFrequencyData}
1getByteTimeDomainData(){return(!this._byteTimeDomainData||this._byteTimeDomainData.length===0)&&(this._byteTimeDomainData=new Uint8Array(this._analyzerNode.fftSize)),this._analyzerNode.getByteTimeDomainData(this._byteTimeDomainData),this._byteTimeDomainData}getFloatFrequencyData(){return(!this._floatFrequencyData||this._floatFrequencyData.length===0)&&(this._floatFrequencyData=new Float32Array(this._analyzerNode.frequencyBinCount)),this._analyzerNode.getFloatFrequencyData(this._floatFrequencyData),this._floatFrequencyData}getFloatTimeDomainData(){return(!this._floatTimeDomainData||this._floatTimeDomainData.length===0)&&(this._floatTimeDomainData=new Float32Array(this._analyzerNode.fftSize)),this._analyzerNode.getFloatTimeDomainData(this._floatTimeDomainData),this._floatTimeDomainData}_clearArrays(){this._byteFrequencyData=null,this._byteTimeDomainData=null,this._floatFrequencyData=null,this._floatTimeDomainData=null}},G=class extends B{constructor(e){super(),this._outputNode=null,this._owner=e}async initAsync(e){let t=k(e);if(t&&await this.createAndAddSubNodeAsync(`Analyzer`),await this.createAndAddSubNodeAsync(`Volume`),await this._createSubNodePromisesResolvedAsync(),t){let t=M(this);if(!t)throw Error(`No analyzer subnode.`);t.setOptions(e)}let n=w(this);if(!n)throw Error(`No volume subnode.`);if(n.setOptions(e),n.getClassName()!==`_VolumeWebAudioSubNode`)throw Error(`Not a WebAudio subnode.`);if(this._outputNode=n.node,this._outputNode&&this._downstreamNodes){let e=this._downstreamNodes.values();for(let t=e.next();!t.done;t=e.next()){let e=t.value._inNode;e&&this._outputNode.connect(e)}}}get _inNode(){return this._outputNode}get _outNode(){return this._outputNode}_createSubNode(e){switch(e){case`Analyzer`:return U(this._owner.engine);case`Volume`:return V(this._owner.engine);default:throw Error(`Unknown subnode name: ${e}`)}}_onSubNodesChanged(){let e=M(this),t=w(this);e&&t&&t.connect(e)}};export{y as a,r as c,x as i,p as l,z as n,_ as o,w as r,f as s,G as t,m as u};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.