Struct web_sys::AudioContext [−][src]
#[repr(transparent)]pub struct AudioContext { /* fields omitted */ }
Expand description
The AudioContext
class.
This API requires the following crate features to be activated: AudioContext
Implementations
Getter for the destination
field of this object.
This API requires the following crate features to be activated: AudioContext
, AudioDestinationNode
Getter for the sampleRate
field of this object.
This API requires the following crate features to be activated: AudioContext
Getter for the currentTime
field of this object.
This API requires the following crate features to be activated: AudioContext
Getter for the listener
field of this object.
This API requires the following crate features to be activated: AudioContext
, AudioListener
Getter for the state
field of this object.
This API requires the following crate features to be activated: AudioContext
, AudioContextState
Getter for the audioWorklet
field of this object.
This API requires the following crate features to be activated: AudioContext
, AudioWorklet
Getter for the onstatechange
field of this object.
This API requires the following crate features to be activated: AudioContext
Setter for the onstatechange
field of this object.
This API requires the following crate features to be activated: AudioContext
The new AudioContext(..)
constructor, creating a new instance of AudioContext
.
This API requires the following crate features to be activated: AudioContext
pub 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
pub fn create_media_element_source(
&self,
media_element: &HtmlMediaElement
) -> Result<MediaElementAudioSourceNode, JsValue>
pub fn create_media_element_source(
&self,
media_element: &HtmlMediaElement
) -> Result<MediaElementAudioSourceNode, JsValue>
The createMediaElementSource()
method.
This API requires the following crate features to be activated: AudioContext
, HtmlMediaElement
, MediaElementAudioSourceNode
pub fn create_media_stream_destination(
&self
) -> Result<MediaStreamAudioDestinationNode, JsValue>
pub fn create_media_stream_destination(
&self
) -> Result<MediaStreamAudioDestinationNode, JsValue>
The createMediaStreamDestination()
method.
This API requires the following crate features to be activated: AudioContext
, MediaStreamAudioDestinationNode
pub fn create_media_stream_source(
&self,
media_stream: &MediaStream
) -> Result<MediaStreamAudioSourceNode, JsValue>
pub fn create_media_stream_source(
&self,
media_stream: &MediaStream
) -> Result<MediaStreamAudioSourceNode, JsValue>
The createMediaStreamSource()
method.
This API requires the following crate features to be activated: AudioContext
, MediaStream
, MediaStreamAudioSourceNode
The createAnalyser()
method.
This API requires the following crate features to be activated: AnalyserNode
, AudioContext
The createBiquadFilter()
method.
This API requires the following crate features to be activated: AudioContext
, BiquadFilterNode
pub fn create_buffer(
&self,
number_of_channels: u32,
length: u32,
sample_rate: f32
) -> Result<AudioBuffer, JsValue>
pub fn create_buffer(
&self,
number_of_channels: u32,
length: u32,
sample_rate: f32
) -> Result<AudioBuffer, JsValue>
The createBuffer()
method.
This API requires the following crate features to be activated: AudioBuffer
, AudioContext
The createBufferSource()
method.
This API requires the following crate features to be activated: AudioBufferSourceNode
, AudioContext
The createChannelMerger()
method.
This API requires the following crate features to be activated: AudioContext
, ChannelMergerNode
pub fn create_channel_merger_with_number_of_inputs(
&self,
number_of_inputs: u32
) -> Result<ChannelMergerNode, JsValue>
pub fn create_channel_merger_with_number_of_inputs(
&self,
number_of_inputs: u32
) -> Result<ChannelMergerNode, JsValue>
The createChannelMerger()
method.
This API requires the following crate features to be activated: AudioContext
, ChannelMergerNode
The createChannelSplitter()
method.
This API requires the following crate features to be activated: AudioContext
, ChannelSplitterNode
pub fn create_channel_splitter_with_number_of_outputs(
&self,
number_of_outputs: u32
) -> Result<ChannelSplitterNode, JsValue>
pub fn create_channel_splitter_with_number_of_outputs(
&self,
number_of_outputs: u32
) -> Result<ChannelSplitterNode, JsValue>
The createChannelSplitter()
method.
This API requires the following crate features to be activated: AudioContext
, ChannelSplitterNode
The createConstantSource()
method.
This API requires the following crate features to be activated: AudioContext
, ConstantSourceNode
The createConvolver()
method.
This API requires the following crate features to be activated: AudioContext
, ConvolverNode
The createDelay()
method.
This API requires the following crate features to be activated: AudioContext
, DelayNode
The createDelay()
method.
This API requires the following crate features to be activated: AudioContext
, DelayNode
The createDynamicsCompressor()
method.
This API requires the following crate features to be activated: AudioContext
, DynamicsCompressorNode
The createGain()
method.
This API requires the following crate features to be activated: AudioContext
, GainNode
pub fn create_iir_filter(
&self,
feedforward: &JsValue,
feedback: &JsValue
) -> Result<IirFilterNode, JsValue>
pub fn create_iir_filter(
&self,
feedforward: &JsValue,
feedback: &JsValue
) -> Result<IirFilterNode, JsValue>
The createIIRFilter()
method.
This API requires the following crate features to be activated: AudioContext
, IirFilterNode
The createOscillator()
method.
This API requires the following crate features to be activated: AudioContext
, OscillatorNode
The createPanner()
method.
This API requires the following crate features to be activated: AudioContext
, PannerNode
The createPeriodicWave()
method.
This API requires the following crate features to be activated: AudioContext
, PeriodicWave
pub fn create_periodic_wave_with_constraints(
&self,
real: &mut [f32],
imag: &mut [f32],
constraints: &PeriodicWaveConstraints
) -> Result<PeriodicWave, JsValue>
pub fn create_periodic_wave_with_constraints(
&self,
real: &mut [f32],
imag: &mut [f32],
constraints: &PeriodicWaveConstraints
) -> Result<PeriodicWave, JsValue>
The createPeriodicWave()
method.
This API requires the following crate features to be activated: AudioContext
, PeriodicWave
, PeriodicWaveConstraints
The createScriptProcessor()
method.
This API requires the following crate features to be activated: AudioContext
, ScriptProcessorNode
pub fn create_script_processor_with_buffer_size(
&self,
buffer_size: u32
) -> Result<ScriptProcessorNode, JsValue>
pub fn create_script_processor_with_buffer_size(
&self,
buffer_size: u32
) -> Result<ScriptProcessorNode, JsValue>
The createScriptProcessor()
method.
This API requires the following crate features to be activated: AudioContext
, ScriptProcessorNode
pub fn create_script_processor_with_buffer_size_and_number_of_input_channels(
&self,
buffer_size: u32,
number_of_input_channels: u32
) -> Result<ScriptProcessorNode, JsValue>
pub fn create_script_processor_with_buffer_size_and_number_of_input_channels(
&self,
buffer_size: u32,
number_of_input_channels: u32
) -> Result<ScriptProcessorNode, JsValue>
The createScriptProcessor()
method.
This API requires the following crate features to be activated: AudioContext
, ScriptProcessorNode
pub fn create_script_processor_with_buffer_size_and_number_of_input_channels_and_number_of_output_channels(
&self,
buffer_size: u32,
number_of_input_channels: u32,
number_of_output_channels: u32
) -> Result<ScriptProcessorNode, JsValue>
pub fn create_script_processor_with_buffer_size_and_number_of_input_channels_and_number_of_output_channels(
&self,
buffer_size: u32,
number_of_input_channels: u32,
number_of_output_channels: u32
) -> Result<ScriptProcessorNode, JsValue>
The createScriptProcessor()
method.
This API requires the following crate features to be activated: AudioContext
, ScriptProcessorNode
The createStereoPanner()
method.
This API requires the following crate features to be activated: AudioContext
, StereoPannerNode
The createWaveShaper()
method.
This API requires the following crate features to be activated: AudioContext
, WaveShaperNode
The decodeAudioData()
method.
This API requires the following crate features to be activated: AudioContext
pub fn decode_audio_data_with_success_callback(
&self,
audio_data: &ArrayBuffer,
success_callback: &Function
) -> Result<Promise, JsValue>
pub fn decode_audio_data_with_success_callback(
&self,
audio_data: &ArrayBuffer,
success_callback: &Function
) -> Result<Promise, JsValue>
The decodeAudioData()
method.
This API requires the following crate features to be activated: AudioContext
pub fn decode_audio_data_with_success_callback_and_error_callback(
&self,
audio_data: &ArrayBuffer,
success_callback: &Function,
error_callback: &Function
) -> Result<Promise, JsValue>
pub fn decode_audio_data_with_success_callback_and_error_callback(
&self,
audio_data: &ArrayBuffer,
success_callback: &Function,
error_callback: &Function
) -> Result<Promise, JsValue>
The decodeAudioData()
method.
This API requires the following crate features to be activated: AudioContext
Methods from Deref<Target = BaseAudioContext>
👎 Deprecated: doesn’t exist in Safari, use AudioContext
instead now
doesn’t exist in Safari, use AudioContext
instead now
Getter for the destination
field of this object.
This API requires the following crate features to be activated: AudioDestinationNode
, BaseAudioContext
👎 Deprecated: doesn’t exist in Safari, use AudioContext
instead now
doesn’t exist in Safari, use AudioContext
instead now
Getter for the sampleRate
field of this object.
This API requires the following crate features to be activated: BaseAudioContext
👎 Deprecated: doesn’t exist in Safari, use AudioContext
instead now
doesn’t exist in Safari, use AudioContext
instead now
Getter for the currentTime
field of this object.
This API requires the following crate features to be activated: BaseAudioContext
👎 Deprecated: doesn’t exist in Safari, use AudioContext
instead now
doesn’t exist in Safari, use AudioContext
instead now
Getter for the listener
field of this object.
This API requires the following crate features to be activated: AudioListener
, BaseAudioContext
👎 Deprecated: doesn’t exist in Safari, use AudioContext
instead now
doesn’t exist in Safari, use AudioContext
instead now
Getter for the state
field of this object.
This API requires the following crate features to be activated: AudioContextState
, BaseAudioContext
👎 Deprecated: doesn’t exist in Safari, use AudioContext
instead now
doesn’t exist in Safari, use AudioContext
instead now
Getter for the audioWorklet
field of this object.
This API requires the following crate features to be activated: AudioWorklet
, BaseAudioContext
👎 Deprecated: doesn’t exist in Safari, use AudioContext
instead now
doesn’t exist in Safari, use AudioContext
instead now
Getter for the onstatechange
field of this object.
This API requires the following crate features to be activated: BaseAudioContext
👎 Deprecated: doesn’t exist in Safari, use AudioContext
instead now
doesn’t exist in Safari, use AudioContext
instead now
Setter for the onstatechange
field of this object.
This API requires the following crate features to be activated: BaseAudioContext
👎 Deprecated: doesn’t exist in Safari, use AudioContext
instead now
doesn’t exist in Safari, use AudioContext
instead now
The createAnalyser()
method.
This API requires the following crate features to be activated: AnalyserNode
, BaseAudioContext
👎 Deprecated: doesn’t exist in Safari, use AudioContext
instead now
doesn’t exist in Safari, use AudioContext
instead now
The createBiquadFilter()
method.
This API requires the following crate features to be activated: BaseAudioContext
, BiquadFilterNode
pub fn create_buffer(
&self,
number_of_channels: u32,
length: u32,
sample_rate: f32
) -> Result<AudioBuffer, JsValue>
👎 Deprecated: doesn’t exist in Safari, use AudioContext
instead now
pub fn create_buffer(
&self,
number_of_channels: u32,
length: u32,
sample_rate: f32
) -> Result<AudioBuffer, JsValue>
doesn’t exist in Safari, use AudioContext
instead now
The createBuffer()
method.
This API requires the following crate features to be activated: AudioBuffer
, BaseAudioContext
👎 Deprecated: doesn’t exist in Safari, use AudioContext
instead now
doesn’t exist in Safari, use AudioContext
instead now
The createBufferSource()
method.
This API requires the following crate features to be activated: AudioBufferSourceNode
, BaseAudioContext
👎 Deprecated: doesn’t exist in Safari, use AudioContext
instead now
doesn’t exist in Safari, use AudioContext
instead now
The createChannelMerger()
method.
This API requires the following crate features to be activated: BaseAudioContext
, ChannelMergerNode
pub fn create_channel_merger_with_number_of_inputs(
&self,
number_of_inputs: u32
) -> Result<ChannelMergerNode, JsValue>
👎 Deprecated: doesn’t exist in Safari, use AudioContext
instead now
pub fn create_channel_merger_with_number_of_inputs(
&self,
number_of_inputs: u32
) -> Result<ChannelMergerNode, JsValue>
doesn’t exist in Safari, use AudioContext
instead now
The createChannelMerger()
method.
This API requires the following crate features to be activated: BaseAudioContext
, ChannelMergerNode
👎 Deprecated: doesn’t exist in Safari, use AudioContext
instead now
doesn’t exist in Safari, use AudioContext
instead now
The createChannelSplitter()
method.
This API requires the following crate features to be activated: BaseAudioContext
, ChannelSplitterNode
pub fn create_channel_splitter_with_number_of_outputs(
&self,
number_of_outputs: u32
) -> Result<ChannelSplitterNode, JsValue>
👎 Deprecated: doesn’t exist in Safari, use AudioContext
instead now
pub fn create_channel_splitter_with_number_of_outputs(
&self,
number_of_outputs: u32
) -> Result<ChannelSplitterNode, JsValue>
doesn’t exist in Safari, use AudioContext
instead now
The createChannelSplitter()
method.
This API requires the following crate features to be activated: BaseAudioContext
, ChannelSplitterNode
👎 Deprecated: doesn’t exist in Safari, use AudioContext
instead now
doesn’t exist in Safari, use AudioContext
instead now
The createConstantSource()
method.
This API requires the following crate features to be activated: BaseAudioContext
, ConstantSourceNode
👎 Deprecated: doesn’t exist in Safari, use AudioContext
instead now
doesn’t exist in Safari, use AudioContext
instead now
The createConvolver()
method.
This API requires the following crate features to be activated: BaseAudioContext
, ConvolverNode
👎 Deprecated: doesn’t exist in Safari, use AudioContext
instead now
doesn’t exist in Safari, use AudioContext
instead now
The createDelay()
method.
This API requires the following crate features to be activated: BaseAudioContext
, DelayNode
pub fn create_delay_with_max_delay_time(
&self,
max_delay_time: f64
) -> Result<DelayNode, JsValue>
👎 Deprecated: doesn’t exist in Safari, use AudioContext
instead now
pub fn create_delay_with_max_delay_time(
&self,
max_delay_time: f64
) -> Result<DelayNode, JsValue>
doesn’t exist in Safari, use AudioContext
instead now
The createDelay()
method.
This API requires the following crate features to be activated: BaseAudioContext
, DelayNode
👎 Deprecated: doesn’t exist in Safari, use AudioContext
instead now
doesn’t exist in Safari, use AudioContext
instead now
The createDynamicsCompressor()
method.
This API requires the following crate features to be activated: BaseAudioContext
, DynamicsCompressorNode
👎 Deprecated: doesn’t exist in Safari, use AudioContext
instead now
doesn’t exist in Safari, use AudioContext
instead now
The createGain()
method.
This API requires the following crate features to be activated: BaseAudioContext
, GainNode
pub fn create_iir_filter(
&self,
feedforward: &JsValue,
feedback: &JsValue
) -> Result<IirFilterNode, JsValue>
👎 Deprecated: doesn’t exist in Safari, use AudioContext
instead now
pub fn create_iir_filter(
&self,
feedforward: &JsValue,
feedback: &JsValue
) -> Result<IirFilterNode, JsValue>
doesn’t exist in Safari, use AudioContext
instead now
The createIIRFilter()
method.
This API requires the following crate features to be activated: BaseAudioContext
, IirFilterNode
👎 Deprecated: doesn’t exist in Safari, use AudioContext
instead now
doesn’t exist in Safari, use AudioContext
instead now
The createOscillator()
method.
This API requires the following crate features to be activated: BaseAudioContext
, OscillatorNode
👎 Deprecated: doesn’t exist in Safari, use AudioContext
instead now
doesn’t exist in Safari, use AudioContext
instead now
The createPanner()
method.
This API requires the following crate features to be activated: BaseAudioContext
, PannerNode
pub fn create_periodic_wave(
&self,
real: &mut [f32],
imag: &mut [f32]
) -> Result<PeriodicWave, JsValue>
👎 Deprecated: doesn’t exist in Safari, use AudioContext
instead now
pub fn create_periodic_wave(
&self,
real: &mut [f32],
imag: &mut [f32]
) -> Result<PeriodicWave, JsValue>
doesn’t exist in Safari, use AudioContext
instead now
The createPeriodicWave()
method.
This API requires the following crate features to be activated: BaseAudioContext
, PeriodicWave
pub fn create_periodic_wave_with_constraints(
&self,
real: &mut [f32],
imag: &mut [f32],
constraints: &PeriodicWaveConstraints
) -> Result<PeriodicWave, JsValue>
👎 Deprecated: doesn’t exist in Safari, use AudioContext
instead now
pub fn create_periodic_wave_with_constraints(
&self,
real: &mut [f32],
imag: &mut [f32],
constraints: &PeriodicWaveConstraints
) -> Result<PeriodicWave, JsValue>
doesn’t exist in Safari, use AudioContext
instead now
The createPeriodicWave()
method.
This API requires the following crate features to be activated: BaseAudioContext
, PeriodicWave
, PeriodicWaveConstraints
👎 Deprecated: doesn’t exist in Safari, use AudioContext
instead now
doesn’t exist in Safari, use AudioContext
instead now
The createScriptProcessor()
method.
This API requires the following crate features to be activated: BaseAudioContext
, ScriptProcessorNode
pub fn create_script_processor_with_buffer_size(
&self,
buffer_size: u32
) -> Result<ScriptProcessorNode, JsValue>
👎 Deprecated: doesn’t exist in Safari, use AudioContext
instead now
pub fn create_script_processor_with_buffer_size(
&self,
buffer_size: u32
) -> Result<ScriptProcessorNode, JsValue>
doesn’t exist in Safari, use AudioContext
instead now
The createScriptProcessor()
method.
This API requires the following crate features to be activated: BaseAudioContext
, ScriptProcessorNode
pub fn create_script_processor_with_buffer_size_and_number_of_input_channels(
&self,
buffer_size: u32,
number_of_input_channels: u32
) -> Result<ScriptProcessorNode, JsValue>
👎 Deprecated: doesn’t exist in Safari, use AudioContext
instead now
pub fn create_script_processor_with_buffer_size_and_number_of_input_channels(
&self,
buffer_size: u32,
number_of_input_channels: u32
) -> Result<ScriptProcessorNode, JsValue>
doesn’t exist in Safari, use AudioContext
instead now
The createScriptProcessor()
method.
This API requires the following crate features to be activated: BaseAudioContext
, ScriptProcessorNode
pub fn create_script_processor_with_buffer_size_and_number_of_input_channels_and_number_of_output_channels(
&self,
buffer_size: u32,
number_of_input_channels: u32,
number_of_output_channels: u32
) -> Result<ScriptProcessorNode, JsValue>
👎 Deprecated: doesn’t exist in Safari, use AudioContext
instead now
pub fn create_script_processor_with_buffer_size_and_number_of_input_channels_and_number_of_output_channels(
&self,
buffer_size: u32,
number_of_input_channels: u32,
number_of_output_channels: u32
) -> Result<ScriptProcessorNode, JsValue>
doesn’t exist in Safari, use AudioContext
instead now
The createScriptProcessor()
method.
This API requires the following crate features to be activated: BaseAudioContext
, ScriptProcessorNode
👎 Deprecated: doesn’t exist in Safari, use AudioContext
instead now
doesn’t exist in Safari, use AudioContext
instead now
The createStereoPanner()
method.
This API requires the following crate features to be activated: BaseAudioContext
, StereoPannerNode
👎 Deprecated: doesn’t exist in Safari, use AudioContext
instead now
doesn’t exist in Safari, use AudioContext
instead now
The createWaveShaper()
method.
This API requires the following crate features to be activated: BaseAudioContext
, WaveShaperNode
👎 Deprecated: doesn’t exist in Safari, use AudioContext
instead now
doesn’t exist in Safari, use AudioContext
instead now
The decodeAudioData()
method.
This API requires the following crate features to be activated: BaseAudioContext
pub fn decode_audio_data_with_success_callback(
&self,
audio_data: &ArrayBuffer,
success_callback: &Function
) -> Result<Promise, JsValue>
👎 Deprecated: doesn’t exist in Safari, use AudioContext
instead now
pub fn decode_audio_data_with_success_callback(
&self,
audio_data: &ArrayBuffer,
success_callback: &Function
) -> Result<Promise, JsValue>
doesn’t exist in Safari, use AudioContext
instead now
The decodeAudioData()
method.
This API requires the following crate features to be activated: BaseAudioContext
pub fn decode_audio_data_with_success_callback_and_error_callback(
&self,
audio_data: &ArrayBuffer,
success_callback: &Function,
error_callback: &Function
) -> Result<Promise, JsValue>
👎 Deprecated: doesn’t exist in Safari, use AudioContext
instead now
pub fn decode_audio_data_with_success_callback_and_error_callback(
&self,
audio_data: &ArrayBuffer,
success_callback: &Function,
error_callback: &Function
) -> Result<Promise, JsValue>
doesn’t exist in Safari, use AudioContext
instead now
The decodeAudioData()
method.
This API requires the following crate features to be activated: BaseAudioContext
Trait Implementations
Performs the conversion.
Performs the conversion.
Performs the conversion.
type Target = BaseAudioContext
type Target = BaseAudioContext
The resulting type after dereferencing.
Dereferences the value.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs a dynamic instanceof
check to see whether the JsValue
provided is an instance of this type. Read more
Performs a zero-cost unchecked conversion from a JsValue
into an
instance of Self
Read more
Performs a zero-cost unchecked conversion from a &JsValue
into an
instance of &Self
. Read more
Test whether this JS value has a type T
. Read more
Performs a dynamic cast (checked at runtime) of this value into the
target type T
. Read more
Performs a dynamic cast (checked at runtime) of this value into the
target type T
. Read more
Performs a zero-cost unchecked cast into the specified type. Read more
Performs a zero-cost unchecked cast into a reference to the specified type. Read more
Test whether this JS value is an instance of the type T
. Read more
Performs a dynamic check to see whether the JsValue
provided
is a value of this type. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
type Abi = <JsValue as RefFromWasmAbi>::Abi
type Abi = <JsValue as RefFromWasmAbi>::Abi
The wasm ABI type references to Self
are recovered from.
type Anchor = ManuallyDrop<AudioContext>
type Anchor = ManuallyDrop<AudioContext>
The type that holds the reference to Self
for the duration of the
invocation of the function that has an &Self
parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous. Read more
Recover a Self::Anchor
from Self::Abi
. Read more
Auto Trait Implementations
impl RefUnwindSafe for AudioContext
impl !Send for AudioContext
impl !Sync for AudioContext
impl Unpin for AudioContext
impl UnwindSafe for AudioContext
Blanket Implementations
Mutably borrows from an owned value. Read more
type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as IntoWasmAbi::Abi
Same as IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
. Read more