AudioContext()

This is an experimental technology
Because this technology's specification has not stabilized, check the compatibility table for usage in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the specification changes.

The AudioContext() constructor creates a new AudioContext object which represents an audio-processing graph, built from audio modules linked together, each represented by an AudioNode.

Syntax

var audioContext = new AudioContext(options)

Parameters

options Optional
Options are as follows:
  • latencyHint: This value identifies type of playback, which affects tradeoffs between audio output latency and power consumption. The prefered values are "balanced", "interactive", and "playback", with the default value: "interactive". These values mean "balance audio output latency and power consumption", "provide lowest audio output latency as possible without glitching", and "prioritize sustained playback without interruption over audio output latency". We can also specify double value for the number of seconds of latency, for finer control.

Specifications

Specification Status Comment
Web Audio API
The definition of 'AudioContext()' in that specification.
Working Draft Initial definition.

Browser Compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 55.0 ? ? 42 ?
Feature Android Android Webview Firefox Mobile (Gecko) Firefox OS IE Mobile Opera Mobile Safari Mobile Chrome for Android
Basic support No support 55.0 ? ? ? 42 ? 55.0

Document Tags and Contributors

 Contributors to this page: bunnybooboo, chaser, chikoski, jpmedley
 Last updated by: bunnybooboo,