is-midi
Check if a Buffer/Uint8Array is a MIDI file
Install
$ npm install is-midi
Usage
Node.js
const readChunk = ; // npm install read-chunkconst isMidi = ;const buffer = readChunk; ;//=> true
Browser
const xhr = ;xhr;xhrresponseType = 'arraybuffer'; xhr { ; //=> true}; xhr;
API
isMidi(buffer)
Accepts a Buffer (Node.js) or Uint8Array.
It only needs the first 4 bytes.
Related
- file-type - Detect the file type of a Buffer/Uint8Array
License
MIT © Chris Vogt