PannerNode.orientationZ
The orientationZ
property of the PannerNode
interface indicates the Z (depth) component of the direction the audio source is facing, in 3D Cartesian coordinate space.
The complete vector is defined by the position of the audio source, given as (positionX
, positionY
, positionZ
), and the orientation of the audio source (that is, the direction in which it's facing), given as (orientationX
, orientationY
, orientationZ
).
Depending on the directionality of the sound (as specified using the attributes coneInnerAngle
, coneOuterAngle
, and codeOuterGain
), the orientation of the sound may alter the perceived volume of the sound as it's being played. If the sound is pointing toward the listener, it will be louder than if the sound is pointed away from the listener.
The AudioParam
contained by this property is read only; however, you can still change the value of the parameter by assigning a new value to its AudioParam.value
property.
Syntax
var orientationZ = PannerNode.orientationZ; PannerNode.orientationZ.value = newOrientationZ;
Value
An AudioParam
whose value
is the Z component of the direction the audio source is facing, in 3D Cartesian coordinate space.
Example
See PannerNode.orientationX
for example code that demonstrates the effect on volume of changing the PannerNode
orientation parameters in combination with coneInnerAngle
and coneOuterAngle
.
Specifications
Specification |
---|
Web Audio API # dom-pannernode-orientationz |
Browser compatibility
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
orientationZ |
52 |
79 |
50 |
No |
39 |
14.1 |
52 |
52 |
50 |
41 |
14.5 |
6.0 |
See also
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/orientationZ