AudioProcessingEvent

Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

The Web Audio API AudioProcessingEvent represents events that occur when a ScriptProcessorNode input buffer is ready to be processed.

Note: As of the August 29 2014 Web Audio API spec publication, this feature has been marked as deprecated, and is soon to be replaced by AudioWorklet.

Properties

The list below includes the properties inherited from its parent, Event.

Property Type Description
target Read only EventTarget The event target (the topmost target in the DOM tree).
type Read only DOMString The type of event.
bubbles Read only boolean Does the event normally bubble?
cancelable Read only boolean Is it possible to cancel the event?
playbackTime Read only double The time when the audio will be played, as defined by the time of AudioContext.currentTime
inputBuffer Read only AudioBuffer The buffer containing the input audio data to be processed. The number of channels is defined as a parameter, numberOfInputChannels, of the factory method AudioContext.createScriptProcessor(). Note the returned AudioBuffer is only valid in the scope of the onaudioprocess function.
outputBuffer Read only AudioBuffer The buffer where the output audio data should be written. The number of channels is defined as a parameter, numberOfOutputChannels, of the factory method AudioContext.createScriptProcessor(). Note the returned AudioBuffer is only valid in the scope of the onaudioprocess function.

Example

See BaseAudioContext.createScriptProcessor() for example code that uses an AudioProcessingEvent.

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
AudioProcessingEvent
14
12
25
No
15
6
≤37
18
25
14
Yes
1.0
AudioProcessingEvent
57
79
No
No
44
14.1
57
57
No
43
14.5
7.0
inputBuffer
14
12
25
No
15
6
≤37
18
25
14
Yes
1.0
outputBuffer
14
12
25
No
15
6
≤37
18
25
14
Yes
1.0
playbackTime
14
12
25
No
15
6
≤37
18
25
14
Yes
1.0

See also

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/AudioProcessingEvent