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",
42 Constructor(BaseAudioContext context, optional PannerOptions options)]
43 interface PannerNode : AudioNode {
45 // Default for stereo is equalpower
46 attribute PanningModelType panningModel;
48 // Uses a 3D cartesian coordinate system
49 void setPosition(double x, double y, double z);
50 void setOrientation(double x, double y, double z);
52 // Cartesian coordinate for position
53 readonly attribute AudioParam positionX;
54 readonly attribute AudioParam positionY;
55 readonly attribute AudioParam positionZ;
57 // Cartesian coordinate for orientation
58 readonly attribute AudioParam orientationX;
59 readonly attribute AudioParam orientationY;
60 readonly attribute AudioParam orientationZ;
62 // Distance model and attributes
63 attribute DistanceModelType distanceModel;
65 attribute double refDistance;
67 attribute double maxDistance;
69 attribute double rolloffFactor;
71 // Directional sound cone
72 attribute double coneInnerAngle;
73 attribute double coneOuterAngle;
75 attribute double coneOuterGain;
80 PannerNode implements AudioNodePassThrough;