duration
Summary
Duration, in seconds, of the PCM audio data in the buffer.
Property of apis/webaudio/AudioBufferapis/webaudio/AudioBuffer
Syntax
Note: This property is read-only.
var result = AudioBuffer.duration;
Return Value
Returns an object of type NumberNumber
Examples
var myArrayBuffer = audioCtx.createBuffer(2, frameCount, audioCtx.sampleRate);
var dur = myArrayBuffer.duration;
Related specifications
- Web Audio API
- W3C Editor’s Draft