{"name":"audio-type","version":"1.0.2","description":"Detect the audio type of a Buffer/Uint8Array","license":"MIT","repository":{"type":"git","url":"git+https://github.com/hemanth/audio-type.git"},"bin":{"audio-type":"cli.js"},"author":{"name":"Hemanth.HM","email":"hemanth.hm@gmail.com","url":"http://h3manth.com"},"engines":{"node":">=4"},"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":"^1.1.0","is-m4a":"^1.1.0","is-mp3":"^1.1.0","is-ogg":"^1.1.0","is-wav":"^1.1.0","read-chunk":"^2.0.0"},"devDependencies":{"browserify":"^8.1.0","mocha":"*"},"gitHead":"a3b85ca4b913be7e9d458400bd83f22693a1f4a2","bugs":{"url":"https://github.com/hemanth/audio-type/issues"},"homepage":"https://github.com/hemanth/audio-type#readme","_id":"audio-type@1.0.2","_shasum":"9fab56b15734a37e56c21ef6ffadb81618af0fc0","_from":".","_npmVersion":"2.14.9","_nodeVersion":"0.12.10","_npmUser":{"name":"hemanth","email":"hemanth.hm@gmail.com"},"dist":{"shasum":"9fab56b15734a37e56c21ef6ffadb81618af0fc0","tarball":"http://registry-npm.ywwl.com/audio-type/download/audio-type-1.0.2.tgz","integrity":"sha512-vEbOFc2+he+/b5tLmnBINnHUYb3GDzW5tNPa9DHdyKdyLxO0w3V1Dtr9wjLswPXByCCt9uTRu6IzHZ/J/Om4uw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCDmkIg2lCblT5JC4pr7ev7GEJQs0oyTPfL6Wd21dlMXwIhAKG5B8mNGy6hR4PB7wZXeb2xAUND0NxjQhT41XRh+b/B"}],"size":3153,"noattachment":false,"key":"/audio-type/-/audio-type-1.0.2.tgz"},"maintainers":[{"name":"hemanth","email":"hemanth.hm@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/audio-type-1.0.2.tgz_1461390557308_0.7186749060638249"},"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":1461390560739,"_cnpm_publish_time":1461390560739,"dist-tags":{"latest":"2.8.0"}}