AudioContext

Struct AudioContext 

Source
pub struct AudioContext { /* private fields */ }
Expand description

The AudioContext class.

MDN Documentation

This API requires the following crate features to be activated: AudioContext

Implementations§

Source§

impl AudioContext

Source

pub fn sink_id(&self) -> JsValue

Getter for the sinkId field of this object.

MDN Documentation

This API requires the following crate features to be activated: AudioContext

This API is unstable and requires --cfg=web_sys_unstable_apis to be activated, as described in the wasm-bindgen guide

Source§

impl AudioContext

Source

pub fn onsinkchange(&self) -> Option<Function>

Getter for the onsinkchange field of this object.

MDN Documentation

This API requires the following crate features to be activated: AudioContext

This API is unstable and requires --cfg=web_sys_unstable_apis to be activated, as described in the wasm-bindgen guide

Source§

impl AudioContext

Source

pub fn set_onsinkchange(&self, value: Option<&Function>)

Setter for the onsinkchange field of this object.

MDN Documentation

This API requires the following crate features to be activated: AudioContext

This API is unstable and requires --cfg=web_sys_unstable_apis to be activated, as described in the wasm-bindgen guide

Source§

impl AudioContext

Source

pub fn destination(&self) -> AudioDestinationNode

Getter for the destination field of this object.

MDN Documentation

This API requires the following crate features to be activated: AudioContext, AudioDestinationNode

Source§

impl AudioContext

Source

pub fn sample_rate(&self) -> f32

Getter for the sampleRate field of this object.

MDN Documentation

This API requires the following crate features to be activated: AudioContext

Source§

impl AudioContext

Source

pub fn current_time(&self) -> f64

Getter for the currentTime field of this object.

MDN Documentation

This API requires the following crate features to be activated: AudioContext

Source§

impl AudioContext

Source

pub fn listener(&self) -> AudioListener

Getter for the listener field of this object.

MDN Documentation

This API requires the following crate features to be activated: AudioContext, AudioListener

Source§

impl AudioContext

Source

pub fn state(&self) -> AudioContextState

Getter for the state field of this object.

MDN Documentation

This API requires the following crate features to be activated: AudioContext, AudioContextState

Source§

impl AudioContext

Source

pub fn audio_worklet(&self) -> Result<AudioWorklet, JsValue>

Getter for the audioWorklet field of this object.

MDN Documentation

This API requires the following crate features to be activated: AudioContext, AudioWorklet

Source§

impl AudioContext

Source

pub fn onstatechange(&self) -> Option<Function>

Getter for the onstatechange field of this object.

MDN Documentation

This API requires the following crate features to be activated: AudioContext

Source§

impl AudioContext

Source

pub fn set_onstatechange(&self, value: Option<&Function>)

Setter for the onstatechange field of this object.

MDN Documentation

This API requires the following crate features to be activated: AudioContext

Source§

impl AudioContext

Source

pub fn new() -> Result<AudioContext, JsValue>

The new AudioContext(..) constructor, creating a new instance of AudioContext.

MDN Documentation

This API requires the following crate features to be activated: AudioContext

Source§

impl AudioContext

Source

pub fn new_with_context_options( context_options: &AudioContextOptions, ) -> Result<AudioContext, JsValue>

The new AudioContext(..) constructor, creating a new instance of AudioContext.

MDN Documentation

This API requires the following crate features to be activated: AudioContext, AudioContextOptions

Source§

impl AudioContext

Source

pub fn close(&self) -> Result<Promise, JsValue>

The close() method.

MDN Documentation

This API requires the following crate features to be activated: AudioContext

Source§

impl