AudioContext

js.html.EventTargetBaseAudioContextjs.html.audio.AudioContext (extern class)

The AudioContext interface represents an audio-processing graph built from audio modules linked together, each represented by an AudioNode.

Documentation AudioContext by Mozilla Contributors, licensed under CC-BY-SA 2.5.

See:

Instance Members

suspend(): js.lib.Promise<Void>

Suspends the progression of time in the audio context, temporarily halting audio hardware access and reducing CPU/battery usage in the process.

Returns
js.lib.Promise<Void>

Closes the audio context, releasing any system audio resources that it uses.

Returns
js.lib.Promise<Void>

createMediaElementSource(mediaElement: js.html.MediaElement): MediaElementAudioSourceNode

Creates a MediaElementAudioSourceNode associated with an HTMLMediaElement. This can be used to play and manipulate audio from video or audio elements.

Name Type
mediaElement js.html.MediaElement
Returns
MediaElementAudioSourceNode

createMediaStreamSource(mediaStream: js.html.MediaStream): MediaStreamAudioSourceNode

Creates a MediaStreamAudioSourceNode associated with a MediaStream representing an audio stream which may come from the local computer microphone or other sources.

Name Type
mediaStream js.html.MediaStream
Returns
MediaStreamAudioSourceNode

createMediaStreamDestination(): MediaStreamAudioDestinationNode

Creates a MediaStreamAudioDestinationNode associated with a MediaStream representing an audio stream which may be stored in a local file or sent to another computer.

Returns
MediaStreamAudioDestinationNode

new(?contextOptions: Null<AudioContextOptions>): Void
Name Type Default
contextOptions Null<AudioContextOptions> (optional)