UNPKG

@babylonjs/core

Version:

Getting started? Play directly with the Babylon.js API using our [playground](https://playground.babylonjs.com/). It also contains a lot of samples to learn how to use it.

57 lines 1.55 kB
import { _StereoAudioSubNode } from "../../abstractAudio/subNodes/stereoAudioSubNode.js"; /** @internal */ export async function _CreateStereoAudioSubNodeAsync(engine) { return new _StereoWebAudioSubNode(engine); } /** @internal */ export class _StereoWebAudioSubNode extends _StereoAudioSubNode { /** @internal */ constructor(engine) { super(engine); this._pan = 0; this.node = new StereoPannerNode(engine._audioContext); } /** @internal */ get pan() { return this._pan; } /** @internal */ set pan(value) { this._pan = value; this.engine._setAudioParam(this.node.pan, value); } /** @internal */ get _inNode() { return this.node; } /** @internal */ get _outNode() { return this.node; } /** @internal */ getClassName() { return "_StereoWebAudioSubNode"; } _connect(node) { const connected = super._connect(node); if (!connected) { return false; } // If the wrapped node is not available now, it will be connected later by the subgraph. if (node._inNode) { this.node.connect(node._inNode); } return true; } _disconnect(node) { const disconnected = super._disconnect(node); if (!disconnected) { return false; } if (node._inNode) { this.node.disconnect(node._inNode); } return true; } } //# sourceMappingURL=stereoWebAudioSubNode.js.map