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 samples per second, for the PCM audio data.

Property of apis/webaudio/AudioBufferapis/webaudio/AudioBuffer

Syntax

Note: This property is read-only.

var result = AudioBuffer.sampleRate;

Return Value

Returns an object of type NumberNumber

Examples

var myArrayBuffer = audioCtx.createBuffer(2, frameCount, audioCtx.sampleRate);
var sr = myArrayBuffer.sampleRate;

Related specifications

Web Audio API
W3C Editor’s Draft