{"name":"audio-type","version":"0.1.3","description":"Detect the audio type of a Buffer/Uint8Array","license":"MIT","repository":{"type":"git","url":"git://github.com/hemanth/audio-type"},"bin":{"audio-type":"cli.js"},"author":{"name":"Hemanth.HM","email":"hemanth.hm@gmail.com","url":"http://h3manth.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha","browser":"browserify -s $npm_package_name -o browser.js ."},"files":["index.js","cli.js"],"keywords":["audio","sound","wav","mp3","flac","type","detect","check","is","binary","buffer","uint8array","cli"],"dependencies":{"is-flac":"^0.1.0","is-m4a":"^0.1.1","is-mp3":"^0.1.0","is-ogg":"^0.1.0","is-wav":"^0.1.0","read-chunk":"^0.1.0"},"devDependencies":{"browserify":"^3.0.0","mocha":"*"},"bugs":{"url":"https://github.com/hemanth/audio-type/issues"},"homepage":"https://github.com/hemanth/audio-type","_id":"audio-type@0.1.3","_shasum":"1a894fe92d6d859b1235d532d1aebbcaf6132d97","_from":".","_npmVersion":"1.4.7","_npmUser":{"name":"hemanth","email":"hemanth.hm@gmail.com"},"maintainers":[{"name":"hemanth","email":"hemanth.hm@gmail.com"}],"dist":{"shasum":"1a894fe92d6d859b1235d532d1aebbcaf6132d97","tarball":"http://registry-npm.ywwl.com/audio-type/download/audio-type-0.1.3.tgz","integrity":"sha512-SJonbq3+u0vclMpVeVzcWC4XIDcuDMAWqaj1qUl8ef68knMkbmDHf61YcftzCSD29nkyEE8gCOu0Hk+TX34Scg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDXiv8znxtT3ZXS/bpy6mJc30+04Ji4tEQ6YILUM9Gh9gIhANNgMDszBWJ3s6DnxLqgKAzEVLdTVOhpYUoxMLG222eC"}],"size":953,"noattachment":false,"key":"/audio-type/-/audio-type-0.1.3.tgz"},"directories":{},"readme":"# audio-type [![test](https://github.com/audiojs/audio-type/actions/workflows/test.js.yml/badge.svg)](https://github.com/audiojs/audio-type/actions/workflows/test.js.yml) [![stable](https://img.shields.io/badge/stability-stable-brightgreen.svg)](http://github.com/badges/stability-badges) [![npm](https://img.shields.io/npm/v/audio-type.svg)](https://www.npmjs.com/package/audio-type) [![license](https://img.shields.io/npm/l/audio.svg)](https://www.npmjs.com/package/audio-type)\n\n> Detect the audio type of a ArrayBuffer/Uint8Array\n\n## Install\n\n```sh\n$ npm i audio-type\n```\n\n## Usage\n\n##### Node.js\n\n```js\nimport readChunk from 'read-chunk'; // npm install read-chunk\nimport audioType from 'audio-type';\nvar buffer = readChunk.sync('meow.wav', 0, 12);\n\naudioType(buffer);\n//=> wav\n```\n\n##### Browser\n\n```js\nimport audioType from './audio-type.js'\n\nvar xhr = new XMLHttpRequest();\nxhr.open('GET', 'meow.flac');\nxhr.responseType = 'arraybuffer';\n\nxhr.onload = function () {\n\taudioType(this.response);\n\t//=> flac\n};\n\nxhr.send();\n```\n\n\n## API\n\n### audioType(buffer)\n\nReturns: `'mp3'`, `'oga'`, `'flac'`, `'wav'`, `'m4a'`, `'opus'`, `'qoa'`\n\n#### buffer\n\nType: `buffer` *(Node.js)*, `arrayBuffer`, `uint8array`\n\nIt only needs the first 12 bytes.\n\n## License\n\nMIT • <a href=\"https://github.com/krishnized/license/\">ॐ</a>\n\n","publish_time":1398915395376,"_cnpm_publish_time":1398915395376,"dist-tags":{"latest":"2.8.0"}}