Skip to content

audiojs/is-audio-buffer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

is-audio-buffer Build Status Greenkeeper badge stable

Check whether an object is instance of AudioBuffer.

Usage

npm install is-audio-buffer

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.

About

if (object instanceof AudioBuffer) { ... }

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published