is-mp3
Check if a Buffer/Uint8Array is a MP3 file.
Install
$ npm install --save is-mp3
$ bower install --save is-mp3
$ component install hemanth/is-mp3
Usage
Node.js
var readChunk = ; // npm install read-chunkvar isMp3 = ;var buffer = ; ;//=> true
Browser
var xhr = ;xhr;xhrresponseType = 'arraybuffer'; xhr { ; //=> true}; xhr;
API
isMp3(buffer)
Accepts a Buffer (Node.js) or Uint8Array.
It only needs the first 4 bytes.
License
MIT © Hemanth.HM