This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

sampleRate

Summary

The sample rate, in sample-frames per second, at which the AudioContext handles audio. It is assumed that all AudioNodes in the context run at this rate. In making this assumption, sample-rate converters or varispeed processors are not supported in real-time processing.

Property of apis/webaudio/AudioContextapis/webaudio/AudioContext

Syntax

Note: This property is read-only.

var result = AudioContext.sampleRate;

Return Value

Returns an object of type NumberNumber

Examples

var audioCtx = new AudioContext();
var mySampleRate = audioCtx.sampleRate;

Related specifications

W3C Web Audio API
W3C Editor’s Draft