setPosition
Summary
Sets the position of the audio source relative to the listener attribute. A 3D cartesian coordinate system is used. The x, y, and z parameters represent the coordinates in 3D space. The default value is (0,0,0).
Method of apis/webaudio/PannerNodeapis/webaudio/PannerNode
Syntax
var = PannerNode.setPosition(x, y, z);
Parameters
x
- Data-type
- Number
y
- Data-type
- Number
z
- Data-type
- Number
Return Value
Returns an object of type NumberNumber
Examples
var audioCtx = new AudioContext();
var panner = audioCtx.createPanner();
panner.setPosition(0,0,0);
Related specifications
- W3C Web Audio API
- W3C Editor’s Draft