1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/.
6 * The origin of this IDL file is
7 * https://webaudio.github.io/web-audio-api/
9 * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
10 * liability, trademark and document use rules apply.
13 enum PanningModelType {
18 enum DistanceModelType {
24 dictionary PannerOptions : AudioNodeOptions {
25 PanningModelType panningModel = "equalpower";
26 DistanceModelType distanceModel = "inverse";
30 float orientationX = 1;
31 float orientationY = 0;
32 float orientationZ = 0;
33 double refDistance = 1;
34 double maxDistance = 10000;
35 double rolloffFactor = 1;
36 double coneInnerAngle = 360;
37 double coneOuterAngle = 360;
38 double coneOuterGain = 0;
41 [Pref="dom.webaudio.enabled",
43 interface PannerNode : AudioNode {
45 constructor(BaseAudioContext context, optional PannerOptions options = {});
47 // Default for stereo is equalpower
48 attribute PanningModelType panningModel;
50 // Uses a 3D cartesian coordinate system
52 undefined setPosition(double x, double y, double z);
54 undefined setOrientation(double x, double y, double z);
56 // Cartesian coordinate for position
57 readonly attribute AudioParam positionX;
58 readonly attribute AudioParam positionY;
59 readonly attribute AudioParam positionZ;
61 // Cartesian coordinate for orientation
62 readonly attribute AudioParam orientationX;
63 readonly attribute AudioParam orientationY;
64 readonly attribute AudioParam orientationZ;
66 // Distance model and attributes
67 attribute DistanceModelType distanceModel;
69 attribute double refDistance;
71 attribute double maxDistance;
73 attribute double rolloffFactor;
75 // Directional sound cone
76 attribute double coneInnerAngle;
77 attribute double coneOuterAngle;
79 attribute double coneOuterGain;
84 PannerNode includes AudioNodePassThrough;