Web Audio playback
Plays generated sound; the audio context stays silent until the person has interacted.
In one line
Can play and mix sound inside the page, after you have tapped
Plays generated sound; the audio context stays silent until the person has interacted.
A site can synthesize and mix sound at sample precision (games, music tools). Autoplay rules keep it quiet until a click, but once resumed it can run for as long as the tab lives.
What it can and can't do
What the user does: You tap Play, Start or anything on the page before sound begins.
It can
- Play sounds, music or game effects that it makes or loads
- Mix and change sounds, such as echo and volume
- Keep sound going while the tab is open
It cannot
- Make sound before you have tapped, clicked or pressed a key
- Listen through your microphone; that needs a separate permission
- Play over a tab you muted yourself
- Change your device volume
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 35 | 2014-05-20 | None |
| Edge | Supported | 12 | 2015-07-29 | None |
| Firefox | Supported | 25 | 2013-10-29 | None |
| Safari | Supported | 14.1 | 2021-04-26 | None |
| Safari on iPhone | Supported | 14.5 | 2021-04-26 | All iOS browsers use WebKit |
| Chrome on Android | Supported | 35 | 2014-05-20 | None |
| Samsung Internet | Supported | 3.0 | 2015-04-10 | None |
How a site asks for it
| API | new AudioContext(); ctx.resume(); AudioWorklet |
| Browser compat keys | api.AudioContextapi.AudioWorklet |
| How access is granted | gesture |
| What the user sees | No prompt (needs a click, tap or keypress) |
| Needs a secure context (HTTPS) | No |
| Needs a user gesture | Yes |
| Activation | sticky |
| How long it lasts | Context state suspended until resumed; lives with the page |
| How to take it back | Nothing to revoke (no permission is stored) |
| Inside an iframe | Cross-origin iframes need allow="autoplay" |
Typical flow
- Create AudioContext (starts suspended)
- On a click call ctx.resume()
- Audio plays through the default output
Data you get
Shape: none
No individual data fields. The signal is the access itself.
Technical limits
- AudioContext starts suspended until user activation on the page (Chrome 71, Firefox 66, Safari since webkitAudioContext)
- Chrome limits about 6 simultaneously active AudioContexts per tab in older versions; Safari limits 4 on iOS (older)
- Cannot choose output device without setSinkId and a permission (selectAudioOutput)
- Sample rate and output latency are readable (fingerprint)
- Cannot read the system volume or other apps' audio
The story
What it is
A page can make sound, but stays silent until you click or tap.
For you
A game or music tool starts making sound only after your first tap. You are never surprised by blaring audio from a new tab.
For makers
Makers get full control over sound: effects, synths and mixing. The gesture rule is how browsers keep ads from shouting at you.
Where you see it
| Type | Example | Apps |
|---|---|---|
| games | A browser game plays footsteps, music and echo effects, all built from code. | Slither.io, Krunker.io |
| music | A web music maker lets you play synths and drums in the browser. | Chrome Music Lab, BandLab, Soundtrap |
| video | A video call tool adds noise cancelling to your voice. | Google Meet, Discord web |
| education | A learning site shows how a sound wave works and plays it. | Ableton Learning Synths |
| security | Audio processing can reveal small differences between devices and is used in fingerprinting. | None named |
| ads | An ad network tries to autoplay a video ad with sound, blocked until you tap. | None named |
Risks
- Device fingerprint
- Surprise sound
What the platform says
- Google: Autoplay policy in Chrome. Chrome explains that sound only plays after you interact with the page.
Good uses and abuse
Legitimate uses
- Games
- Synths and DAWs
- UI sound design
Known abuse
- Hidden ultrasonic beacons (cross-device tracking)
- Audio fingerprinting
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 1 of 5 | How revealing the data is |
| Utility | 4 of 5 | How useful it is to honest apps |
| Friction | 1 of 5 | How much the user has to do |
| Fingerprint bits | 2 | Rough identifying entropy, when known |
History
- 2018-12, Chrome 71: AudioContext autoplay policy enforced
- 2019-03, Firefox 66: AudioContext needs user gesture
- 2023-02, Chrome 110: AudioContext.setSinkId lets a page route output to a chosen device
Related capabilities
Related
- Autoplay audio and video. Can start muted video on its own, and sound only after you have interacted
Sources
How well checked: Based on official documentation.