export class SpatialAudio {
    panner;
    constructor(options) {
        this.panner = options.context.createPanner();
        this.panner.panningModel = "HRTF";
        this.panner.distanceModel = "inverse";
        this.panner.maxDistance = options.maxDistance ?? 10_000;
        this.panner.refDistance = options.refDistance ?? 1;
        this.panner.rolloffFactor = options.rolloffFactor ?? 1;
        this.panner.connect(options.destination ?? options.context.destination);
        this.setPosition(options.position ?? { x: 0, y: 0, z: 0 });
    }
    setPosition(position) {
        this.panner.positionX.value = position.x;
        this.panner.positionY.value = position.y;
        this.panner.positionZ.value = position.z;
    }
    dispose() {
        this.panner.disconnect();
    }
}
//# sourceMappingURL=SpatialAudio.js.map