{"name":"audio-type","version":"0.1.4","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.4","_shasum":"b1d9c597513fc144000e171a06d67e2b729d61a7","_from":".","_npmVersion":"1.4.7","_npmUser":{"name":"hemanth","email":"hemanth.hm@gmail.com"},"maintainers":[{"name":"hemanth","email":"hemanth.hm@gmail.com"}],"dist":{"shasum":"b1d9c597513fc144000e171a06d67e2b729d61a7","tarball":"http://registry-npm.ywwl.com/audio-type/download/audio-type-0.1.4.tgz","integrity":"sha512-fY4IW+TW0tBUyppwlYVvrZEChLomZJfwm2W9V0dUkWt9/Q1QvBjfCd2GQC788US/esS3WZrLkKkt/U7H2uipIA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEHqFMasP0sHW3tqkU7D9E53dZjAa6bYjVb8Ml+xAZjnAiEAqhGdRm5EOVmuseBtv4LRqD9lGPWTNdDv6xPRrAxYz54="}],"size":1638,"noattachment":false,"key":"/audio-type/-/audio-type-0.1.4.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":1399563610439,"_cnpm_publish_time":1399563610439,"dist-tags":{"latest":"2.8.0"}}