pub struct StereoPannerNode { /* private fields */ }
Expand description

StereoPannerNode positions an incoming audio stream in a stereo image

Implementations

StereoPannerNode can be used to pan an audio stream left or right.

It is an audio-processing module that positions an incoming audio stream in a stereo image using a low-cost panning algorithm.

Usage

use web_audio_api::context::{BaseAudioContext, AudioContext};
use web_audio_api::node::{AudioNode, AudioScheduledSourceNode};

// create an `AudioContext`
let context = AudioContext::default();
// load and decode a soundfile
let panner = context.create_stereo_panner();
panner.connect(&context.destination());
// position source on the left
panner.pan().set_value(-1.);

// pipe an oscillator into the stereo panner
let osc = context.create_oscillator();
osc.frequency().set_value(200.);
osc.connect(&panner);
osc.start();

Examples

  • cargo run --release --example stereo_panner

returns a StereoPannerNode instance

Arguments
  • context - audio context in which the audio node will live.
  • options - stereo panner options
Panics

Will panic if:

  • options.channel_config.count is greater than 2
  • options.channel_config.mode is ChannelCountMode::Max

Returns the pan audio paramter

Trait Implementations

The number of inputs feeding into the AudioNode. For source nodes, this will be 0.
The number of outputs coming out of the AudioNode.
Represents an enumerated value describing the way channels must be matched between the node’s inputs and outputs. Read more
Update the channel_count_mode attribute
Update the channel_count attribute
The BaseAudioContext concrete type which owns this AudioNode. Read more
Connect the output of this AudioNode to the input of another node. Read more
Connect a specific output of this AudioNode to a specific input of another node. Read more
Disconnects all outputs of the AudioNode that go to a specific destination AudioNode.
Disconnects all outgoing connections from the AudioNode.
Represents an enumerated value describing the meaning of the channels. This interpretation will define how audio up-mixing and down-mixing will happen. Read more
Update the channel_interpretation attribute
Represents an integer used to determine how many channels are used when up-mixing and down-mixing connections to any inputs to the node. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.