Methods

This section describes the methods associated with the HTML5 Web Audio APIs. These APIs conform to the emerging W3C Web Audio standard.

In this section

TopicDescription

cancelScheduledValues

Cancels all scheduled parameter changes with a time greater than or equal to a specific start time.

connect

Connects the output of one AudioNode to the input of another AudioNode.

createAnalyser

Creates and returns an AnalyserNode for real-time frequency and time-domain analysis information.

createBiquadFilter

Creates and returns a BiquadFilterNode which represents a second order filter.

createBuffer

Creates and returns a buffer of a specific size. Audio data is initialized to zero (silent).

createBufferSource

Creates and returns an AudioBufferSourceNode object.

createChannelMerger

Creates and returns a ChannelMergerNode which combines channels from multiple audio streams into a single stream.

createChannelSplitter

Creates a ChannelSplitterNode to assess individual channels of an audio stream.

createConvolver

Creates a ConvolverNode used to apply a linear effect often used to simulate an acoustic space, such as a concert hall or small room, or more complex effects such as playing through a vintage speaker or a telephone.

createDelay

Creates a DelayNode to use for a variable delay line.

createDynamicsCompressor

Creates a DynamicsCompressorNode to use for a dynamics compression effect.

createGain

Creates a GainNode to control the volume of an audio source.

createMediaElementSource

Creates and returns a MediaElementAudioSourceNode object for a specific media element. When called, reroutes audio playback for the media element into the processing graph of the AudioContext.

createMediaStreamDestination

Creates and returns a MediaStreamAudioDestinationNode object.

createMediaStreamSource

Creates and returns a MediaStreamAudioSourceNode object for a specific MediaStream (returned by getUerMedia).

createOscillator

Creates an OscillatorNode used to generate periodic waveforms (musical notes, control signals, effects).

createPanner

Creates a PannerNode object to use to position and spatialize an audio source relative to a listener on audio playback.

createPeriodicWave

Creates a PeriodicWave object that represents arbitrary harmonic content that can be used with OscillatorNode.

createScriptProcessor

Creates and returns a ScriptProcessorNode for direct audio processing.

createStereoPanner

Creates a StereoPannerNode.

createWaveShaper

Creates a WaveShaperNode to use for non-linear distortion or other effects.

decodeAudioData

Asynchronously decodes the audio data in the AudioBuffer.

disconnect

Disconnects an AudioNode output connection.

exponentialRampToValueAtTime

Schedules a continuous exponential change of an AudioParam value from the previous parameter value to a new value.

getByteFrequencyData

Returns the frequency data from the AnalyserNode into an unsigned byte array.

getByteTimeDomainData

Returns the current time-domain (waveform) data into an unsigned byte array.

getChannelData

Returns an array of Pulse Code Modulation (PCM) audio data for a specific channel.

getFloatFrequencyData

Creates a copy of the current frequency data into a floating-point array.

getFloatTimeDomainData

Creates a copy of the current time-domain (waveform) data into a floating-point array.

getFrequencyResponse

Returns the frequency response for the specified frequencies, based on the given filter parameter settings.

linearRampToValueAtTime

Schedules a continuous linear change to a AudioParam value from the previous parameter value to a new value.

setOrientation

Sets the direction in terms of front and up, that a listener is pointing in a 3D coordinate system.

setOrientation

Sets the direction in 3D Cartesian space where the audio source is pointing.

setPeriodicWave

Sets a custom waveform for an OscillatorNode to a given PeriodicWave created with createPeriodicWave.

setPosition

Sets the position of the audio source as relative to the AudioContext listener (0,0,0) attribute.

setTargetAtTime

Changes an AudioParam value exponentially toward a given target at rate set by a given time constant.

setValueAtTime

Schedules an AudioParam value to change at a specific time.

setValueCurveAtTime

Creates custom curve to change an AudioParam value.

setVelocity

Sets or gets the velocity vector in meters/second to control the direction of travel and speed of an audio source in 3D space.

start

Schedules an audio resource to play at a specific time.

startRendering

Starts asynchronously rendering audio on an OfflineAudioContext, and returns a promise that represents an AudioBuffer when the data is rendered.

stop

Schedules an audio resource to stop playing at a specific time.

 

 

 

Show: