Struct web_audio_api::context::BaseAudioContext[][src]

pub struct BaseAudioContext { /* fields omitted */ }
Expand description

The BaseAudioContext interface represents an audio-processing graph built from audio modules linked together, each represented by an AudioNode. An audio context controls both the creation of the nodes it contains and the execution of the audio processing, or decoding.

Implementations

impl BaseAudioContext[src]

pub fn sample_rate(&self) -> SampleRate[src]

The sample rate (in sample-frames per second) at which the AudioContext handles audio.

pub fn current_time(&self) -> f64[src]

This is the time in seconds of the sample frame immediately following the last sample-frame in the block of audio most recently processed by the context’s rendering graph.

pub fn channels(&self) -> u32[src]

Number of channels for the audio destination

pub fn register<T: AudioNode, F: FnOnce(AudioContextRegistration) -> (T, Box<dyn AudioProcessor>)>(
    &self,
    f: F
) -> T
[src]

Construct a new pair of node::AudioNode and AudioProcessor

The AudioNode lives in the user-facing control thread. The Processor is sent to the render thread.

Trait Implementations

impl AsBaseAudioContext for BaseAudioContext[src]

fn base(&self) -> &BaseAudioContext[src]

fn create_oscillator(&self) -> OscillatorNode[src]

Creates an OscillatorNode, a source representing a periodic waveform. It basically generates a tone. Read more

fn create_gain(&self) -> GainNode[src]

Creates an GainNode, to control audio volume

fn create_constant_source(&self) -> ConstantSourceNode[src]

Creates an ConstantSourceNode, a source representing a constant value

fn create_delay(&self, max_delay_time: f32) -> DelayNode[src]

Creates a DelayNode, delaying the audio signal

fn create_channel_splitter(&self, number_of_outputs: u32) -> ChannelSplitterNode[src]

Creates a ChannelSplitterNode

fn create_channel_merger(&self, number_of_inputs: u32) -> ChannelMergerNode[src]

Creates a ChannelMergerNode

fn create_media_stream_source<M: MediaStream>(
    &self,
    media: M
) -> MediaStreamAudioSourceNode
[src]

Creates a MediaStreamAudioSourceNode from a MediaElement

fn create_media_element_source(
    &self,
    media: MediaElement
) -> MediaElementAudioSourceNode
[src]

Creates a MediaElementAudioSourceNode from a MediaElement Read more

fn create_buffer_source(&self) -> AudioBufferSourceNode[src]

Creates an AudioBufferSourceNode Read more

fn create_panner(&self) -> PannerNode[src]

Creates a PannerNode

fn create_analyser(&self) -> AnalyserNode[src]

Creates a AnalyserNode

fn create_audio_param(
    &self,
    opts: AudioParamOptions,
    dest: &AudioNodeId
) -> (AudioParam, AudioParamId)
[src]

Create an AudioParam. Read more

fn destination(&self) -> DestinationNode[src]

Returns an AudioDestinationNode representing the final destination of all audio in the context. It can be thought of as the audio-rendering device. Read more

fn listener(&self) -> AudioListener[src]

Returns the AudioListener which is used for 3D spatialization

fn sample_rate(&self) -> SampleRate[src]

The sample rate (in sample-frames per second) at which the AudioContext handles audio.

fn current_time(&self) -> f64[src]

This is the time in seconds of the sample frame immediately following the last sample-frame in the block of audio most recently processed by the context’s rendering graph. Read more

impl Clone for BaseAudioContext[src]

fn clone(&self) -> BaseAudioContext[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl PartialEq<BaseAudioContext> for BaseAudioContext[src]

fn eq(&self, other: &Self) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.