← Back to release summary

AudioContextOptions.sampleRate

Category
Multimedia
Type
New or changed feature
Status
Enabled by default (Chrome 74)
Intent stage
Evaluate readiness to ship

WPT details: This cannot be tested using WPT because there is no exposed way to get at the resampled values.

Summary

Allows developers to set the "sampleRate" for an AudioContext at the time it is created. This allows developers to set an arbitrary sample rate for audio processing in Web Audio API.

Motivation

This allows developers to control the sample rate separatly from the hardware rate. Use this to reduce complexity (using a lower sample rate) or to make the sample rate consistent across devices by using a fixed rate and letting WebAudio resample appropriately for the hardware rate.

Standards & signals

Ecosystem

Docs: https://webaudio.github.io/web-audio-api/#dom-audiocontextoptions-samplerate

View on chromestatus.com