is-audio-buffer
v1.1.0
Published
Check whether an object is instance of AudioBuffer
Downloads
13,799
Readme
is-audio-buffer
Check whether an object is instance of AudioBuffer.
Usage
var isAudioBuffer = require('is-audio-buffer');
var ctx = require('audio-context');
var AudioBuffer = require('audio-buffer');
isAudioBuffer(ctx.createBuffer(2, 100, 44100)); //true
isAudioBuffer(new AudioBuffer([1, 0, 1, 0])); //true
isAudioBuffer(new Float32Array([1, 2, 3])); //false
isAudioBuffer(); //false
Because there is too many implementations of AudioBuffer (1, 2, 3, 4) to rely on a instanceof AudioBuffer
.