Web Audio API
The StereoPannerNode interface of the Web Audio API represents a simple stereo panner node that can be used to pan an audio stream left or right. It is an AudioNode audio-processing module that positions an incoming audio stream in a stereo image using a low-cost equal-power panning algorithm.
The StereoPannerNode.pan property takes a unitless value between -1 (full left pan) and 1 (full right pan). This interface was introduced as a much simpler way to apply a simple panning effect than having to use a full PannerNode.
The Stereo Panner Node moved the sound's position from the center of two speakers to the left.
<table class="properties"> <tbody> <tr> <th scope="row">Number of inputs</th> <td><code>1</code></td> </tr> <tr> <th scope="row">Number of outputs</th> <td><code>1</code></td> </tr> <tr> <th scope="row">Channel count mode</th> <td><code>"clamped-max"</code></td> </tr> <tr> <th scope="row">Channel count</th> <td><code>2</code></td> </tr> <tr> <th scope="row">Channel interpretation</th> <td><code>"speakers"</code></td> </tr> </tbody> </table>
Constructor
- StereoPannerNode.StereoPannerNode
- : Creates a new instance of a
StereoPannerNodeobject.
- : Creates a new instance of a
Instance properties
Inherits properties from its parent, AudioNode.
- StereoPannerNode.pan
- : An a-rate AudioParam representing the amount of panning to apply.
Instance methods
No specific method; inherits methods from its parent, AudioNode.
Example
See BaseAudioContext.createStereoPanner() for example code.
Specifications
Browser compatibility
See also
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
