pub struct AudioContext { /* private fields */ }
Expand description
The AudioContext
class.
This API requires the following crate features to be activated: AudioContext
Implementations§
Source§impl AudioContext
impl AudioContext
Sourcepub fn sink_id(&self) -> JsValue
pub fn sink_id(&self) -> JsValue
Getter for the sinkId
field of this object.
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
impl AudioContext
Sourcepub fn onsinkchange(&self) -> Option<Function>
pub fn onsinkchange(&self) -> Option<Function>
Getter for the onsinkchange
field of this object.
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
impl AudioContext
Sourcepub fn set_onsinkchange(&self, value: Option<&Function>)
pub fn set_onsinkchange(&self, value: Option<&Function>)
Setter for the onsinkchange
field of this object.
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
impl AudioContext
Sourcepub fn destination(&self) -> AudioDestinationNode
pub fn destination(&self) -> AudioDestinationNode
Getter for the destination
field of this object.
This API requires the following crate features to be activated: AudioContext
, AudioDestinationNode
Source§impl AudioContext
impl AudioContext
Sourcepub fn sample_rate(&self) -> f32
pub fn sample_rate(&self) -> f32
Getter for the sampleRate
field of this object.
This API requires the following crate features to be activated: AudioContext
Source§impl AudioContext
impl AudioContext
Sourcepub fn current_time(&self) -> f64
pub fn current_time(&self) -> f64
Getter for the currentTime
field of this object.
This API requires the following crate features to be activated: AudioContext
Source§impl AudioContext
impl AudioContext
Sourcepub fn listener(&self) -> AudioListener
pub fn listener(&self) -> AudioListener
Getter for the listener
field of this object.
This API requires the following crate features to be activated: AudioContext
, AudioListener
Source§impl AudioContext
impl AudioContext
Sourcepub fn state(&self) -> AudioContextState
pub fn state(&self) -> AudioContextState
Getter for the state
field of this object.
This API requires the following crate features to be activated: AudioContext
, AudioContextState
Source§impl AudioContext
impl AudioContext
Sourcepub fn audio_worklet(&self) -> Result<AudioWorklet, JsValue>
pub fn audio_worklet(&self) -> Result<AudioWorklet, JsValue>
Getter for the audioWorklet
field of this object.
This API requires the following crate features to be activated: AudioContext
, AudioWorklet
Source§impl AudioContext
impl AudioContext
Sourcepub fn onstatechange(&self) -> Option<Function>
pub fn onstatechange(&self) -> Option<Function>
Getter for the onstatechange
field of this object.
This API requires the following crate features to be activated: AudioContext
Source§impl AudioContext
impl AudioContext
Sourcepub fn set_onstatechange(&self, value: Option<&Function>)
pub fn set_onstatechange(&self, value: Option<&Function>)
Setter for the onstatechange
field of this object.
This API requires the following crate features to be activated: AudioContext
Source§impl AudioContext
impl AudioContext
Sourcepub fn new() -> Result<AudioContext, JsValue>
pub fn new() -> Result<AudioContext, JsValue>
The new AudioContext(..)
constructor, creating a new instance of AudioContext
.
This API requires the following crate features to be activated: AudioContext
Source§impl AudioContext
impl AudioContext
Sourcepub fn new_with_context_options(
context_options: &AudioContextOptions,
) -> Result<AudioContext, JsValue>
pub fn new_with_context_options( context_options: &AudioContextOptions, ) -> Result<AudioContext, JsValue>
The new AudioContext(..)
constructor, creating a new instance of AudioContext
.
This API requires the following crate features to be activated: AudioContext
, AudioContextOptions