UNPKG

3.29 kBTypeScriptView Raw
1import { Param } from "../../core/context/Param.js";
2import { ToneAudioNode, ToneAudioNodeOptions } from "../../core/context/ToneAudioNode.js";
3import { Degrees, GainFactor } from "../../core/type/Units.js";
4import "../../core/context/Listener.js";
5export interface Panner3DOptions extends ToneAudioNodeOptions {
6 coneInnerAngle: Degrees;
7 coneOuterAngle: Degrees;
8 coneOuterGain: GainFactor;
9 distanceModel: DistanceModelType;
10 maxDistance: number;
11 orientationX: number;
12 orientationY: number;
13 orientationZ: number;
14 panningModel: PanningModelType;
15 positionX: number;
16 positionY: number;
17 positionZ: number;
18 refDistance: number;
19 rolloffFactor: number;
20}
21/**
22 * A spatialized panner node which supports equalpower or HRTF panning.
23 * @category Component
24 */
25export declare class Panner3D extends ToneAudioNode<Panner3DOptions> {
26 readonly name: string;
27 /**
28 * The panning object
29 */
30 private _panner;
31 readonly input: PannerNode;
32 readonly output: PannerNode;
33 readonly positionX: Param<"number">;
34 readonly positionY: Param<"number">;
35 readonly positionZ: Param<"number">;
36 readonly orientationX: Param<"number">;
37 readonly orientationY: Param<"number">;
38 readonly orientationZ: Param<"number">;
39 /**
40 * @param positionX The initial x position.
41 * @param positionY The initial y position.
42 * @param positionZ The initial z position.
43 */
44 constructor(positionX: number, positionY: number, positionZ: number);
45 constructor(options?: Partial<Panner3DOptions>);
46 static getDefaults(): Panner3DOptions;
47 /**
48 * Sets the position of the source in 3d space.
49 */
50 setPosition(x: number, y: number, z: number): this;
51 /**
52 * Sets the orientation of the source in 3d space.
53 */
54 setOrientation(x: number, y: number, z: number): this;
55 /**
56 * The panning model. Either "equalpower" or "HRTF".
57 */
58 get panningModel(): PanningModelType;
59 set panningModel(val: PanningModelType);
60 /**
61 * A reference distance for reducing volume as source move further from the listener
62 */
63 get refDistance(): number;
64 set refDistance(val: number);
65 /**
66 * Describes how quickly the volume is reduced as source moves away from listener.
67 */
68 get rolloffFactor(): number;
69 set rolloffFactor(val: number);
70 /**
71 * The distance model used by, "linear", "inverse", or "exponential".
72 */
73 get distanceModel(): DistanceModelType;
74 set distanceModel(val: DistanceModelType);
75 /**
76 * The angle, in degrees, inside of which there will be no volume reduction
77 */
78 get coneInnerAngle(): Degrees;
79 set coneInnerAngle(val: Degrees);
80 /**
81 * The angle, in degrees, outside of which the volume will be reduced
82 * to a constant value of coneOuterGain
83 */
84 get coneOuterAngle(): Degrees;
85 set coneOuterAngle(val: Degrees);
86 /**
87 * The gain outside of the coneOuterAngle
88 */
89 get coneOuterGain(): GainFactor;
90 set coneOuterGain(val: GainFactor);
91 /**
92 * The maximum distance between source and listener,
93 * after which the volume will not be reduced any further.
94 */
95 get maxDistance(): number;
96 set maxDistance(val: number);
97 dispose(): this;
98}