Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. PannerNode

PannerNode

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

ThePannerNode interface defines an audio-processing object that represents the location, direction, and behavior of an audio source signal in a simulated physical space. ThisAudioNode uses right-hand Cartesian coordinates to describe the source'sposition as a vector and itsorientation as a 3D directional cone.

APannerNode always has exactly one input and one output: the input can bemono orstereo but the output is alwaysstereo (2 channels); you can't have panning effects without at least two audio channels!

The PannerNode defines a spatial position and direction for a given signal.

EventTarget AudioNode PannerNode
Number of inputs1
Number of outputs1
Channel count mode"clamped-max"
Channel count2
Channel interpretation"speakers"

Constructor

PannerNode()

Creates a newPannerNode object instance.

Instance properties

Inherits properties from its parent,AudioNode.

Note:The orientation and position value are set and retrieved using different syntaxes, since they're stored asAudioParam values. Retrieval is done by accessing, for example,PannerNode.positionX. While setting the same property is done withPannerNode.positionX.value. This is why these values are not marked read only, which is how they appear in the WebIDL.

PannerNode.coneInnerAngle

A double value describing the angle, in degrees, of a cone inside of which there will be no volume reduction.

PannerNode.coneOuterAngle

A double value describing the angle, in degrees, of a cone outside of which the volume will be reduced by a constant value, defined by theconeOuterGain property.

PannerNode.coneOuterGain

A double value describing the amount of volume reduction outside the cone defined by theconeOuterAngle attribute. Its default value is0, meaning that no sound can be heard.

PannerNode.distanceModel

An enumerated value determining which algorithm to use to reduce the volume of the audio source as it moves away from the listener. Possible values are"linear","inverse" and"exponential". The default value is"inverse".

PannerNode.maxDistance

A double value representing the maximum distance between the audio source and the listener, after which the volume is not reduced any further.

PannerNode.orientationX

Represents the horizontal position of the audio source's vector in a right-hand Cartesian coordinate system. While thisAudioParam cannot be directly changed, its value can be altered using itsvalue property. The default is value is 1.

PannerNode.orientationY

Represents the vertical position of the audio source's vector in a right-hand Cartesian coordinate system. The default is 0. While thisAudioParam cannot be directly changed, its value can be altered using itsvalue property. The default is value is 0.

PannerNode.orientationZ

Represents the longitudinal (back and forth) position of the audio source's vector in a right-hand Cartesian coordinate system. The default is 0. While thisAudioParam cannot be directly changed, its value can be altered using itsvalue property. The default is value is 0.

PannerNode.panningModel

An enumerated value determining which spatialization algorithm to use to position the audio in 3D space.

PannerNode.positionX

Represents the horizontal position of the audio in a right-hand Cartesian coordinate system. The default is 0. While thisAudioParam cannot be directly changed, its value can be altered using itsvalue property. The default is value is 0.

PannerNode.positionY

Represents the vertical position of the audio in a right-hand Cartesian coordinate system. The default is 0. While thisAudioParam cannot be directly changed, its value can be altered using itsvalue property. The default is value is 0.

PannerNode.positionZ

Represents the longitudinal (back and forth) position of the audio in a right-hand Cartesian coordinate system. The default is 0. While thisAudioParam cannot be directly changed, its value can be altered using itsvalue property. The default is value is 0.

PannerNode.refDistance

A double value representing the reference distance for reducing volume as the audio source moves further from the listener. For distances greater than this the volume will be reduced based onrolloffFactor anddistanceModel.

PannerNode.rolloffFactor

A double value describing how quickly the volume is reduced as the source moves away from the listener. This value is used by all distance models.

Instance methods

Inherits methods from its parent,AudioNode.

PannerNode.setPosition()Deprecated

Defines the position of the audio source relative to the listener (represented by anAudioListener object stored in theBaseAudioContext.listener attribute.)

PannerNode.setOrientation()Deprecated

Defines the direction the audio source is playing in.

Examples

SeeBaseAudioContext.createPanner() for example code.

Specifications

Specification
Web Audio API
# PannerNode

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp