is-wav
Check if a Buffer/Uint8Array is a wav file.
Last updated 10 years ago by hemanth .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install is-wav 
SYNC missed versions from official npm registry.

is-wav Build Status

Check if a Buffer/Uint8Array is a WAV file.

Install

$ npm install --save is-wav
$ bower install --save is-wav
$ component install hemanth/is-wav

Usage

Node.js
var readChunk = require('read-chunk'); // npm install read-chunk
var isWav = require('is-wav');
var buffer = readChunk('meow.wav', 0, 12);

isWav(buffer);
//=> true
Browser
var xhr = new XMLHttpRequest();
xhr.open('GET', 'meow.wav');
xhr.responseType = 'arraybuffer';

xhr.onload = function () {
	isWav(new Uint8Array(this.response));
	//=> true
};

xhr.send();

API

isWav(buffer)

Accepts a Buffer (Node.js) or Uint8Array.

It only needs the first 12 bytes.

License

MIT © Hemanth.HM

Current Tags

  • 1.1.2                                ...           latest (10 years ago)

8 Versions

  • 1.1.2                                ...           10 years ago
  • 1.1.0                                ...           11 years ago
  • 1.0.0                                ...           11 years ago
  • 0.3.0                                ...           11 years ago
  • 0.2.0                                ...           11 years ago
  • 0.1.2                                ...           12 years ago
  • 0.1.1                                ...           12 years ago
  • 0.1.0                                ...           12 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (0)
None
Dev Dependencies (3)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |