Back to Content

StereoPannerNode

files/en-us/web/api/stereopannernode/index.md

latest2.2 KB
Original Source

{{APIRef("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 {{domxref("AudioNode")}} audio-processing module that positions an incoming audio stream in a stereo image using a low-cost equal-power panning algorithm.

The {{domxref("StereoPannerNode.pan", "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 {{domxref("PannerNode")}}.

{{InheritanceDiagram}}

<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

  • {{domxref("StereoPannerNode.StereoPannerNode", "StereoPannerNode()")}}
    • : Creates a new instance of a StereoPannerNode object.

Instance properties

Inherits properties from its parent, {{domxref("AudioNode")}}.

  • {{domxref("StereoPannerNode.pan")}} {{ReadOnlyInline}}
    • : An a-rate {{domxref("AudioParam")}} representing the amount of panning to apply.

Instance methods

No specific method; inherits methods from its parent, {{domxref("AudioNode")}}.

Example

See BaseAudioContext.createStereoPanner() for example code.

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also