{"name":"audio-type","version":"2.1.1","description":"Detect the audio type of a Buffer/Uint8Array","license":"MIT","repository":{"type":"git","url":"git+https://github.com/audiojs/audio-type.git"},"type":"module","main":"audio-type.js","author":{"name":"Hemanth.HM","email":"hemanth.hm@gmail.com","url":"http://h3manth.com"},"engines":{"node":">=14"},"scripts":{"test":"node test"},"keywords":["audiojs","audio","sound","wav","mp3","flac","type","detect","check","is","binary","uint8array"],"devDependencies":{"read-chunk":"^2.0.0","tape":"^4.6.3"},"gitHead":"713630b1026bba701acb99cbc0d76b344b5a5bd9","bugs":{"url":"https://github.com/audiojs/audio-type/issues"},"homepage":"https://github.com/audiojs/audio-type#readme","_id":"audio-type@2.1.1","_nodeVersion":"18.9.1","_npmVersion":"8.19.1","dist":{"integrity":"sha512-1+gm832rCEj+SYLFRlAEwjJNa3RpLtQhnDapBCmYoISRwqfx2GLP9LpiUGIpSoGtd0XKRNipN2J+PfkIi/a8Xg==","shasum":"f59787e157bb0dac8383e33b9957f8341e09ecf9","tarball":"http://registry-npm.ywwl.com/audio-type/download/audio-type-2.1.1.tgz","fileCount":4,"unpackedSize":4907,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCOUEAl7zoI8LSMb8XOvGF1P6yAYk06j3G/CO9l5ouM7AIgM/pgjXw6/fPxxYZpQ9TbKO6zWKj0db6MrBarkblCN2o="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkAXK7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrIEA/+Ks3L5yndtRd2voMtWEi1SwRcWRZqKO7DSRyJNjmrlFeyHBIH\r\noJ/yC52YixIOWfVsL24J/RiJRf5++GnW5velVrizk0xWJHs++QOCbs2w/Lyo\r\n+NhUlP6jGWyqHsQYW6JTIhkqJ6ZsZ6ts7gSxq9AdxZ3xqjd6IzhkP7k7VWkr\r\nvVBXdLWfMcXevYFzsAVmFHg+A2P8soZ6xA79kVa4OGqc8xeNe/zptQ3XgUlf\r\naQp9CkID5igKrfAd511+DS4q5QxUECMpmHGbSJOVq1fomSwkIuob9MWKdByF\r\nbvxtNRXTzEUrSRQIxrJDqMvFzX0CgEuckjnhLQxQ9+zn//BJSipX8ZcB/Khv\r\nJ1S69c6GcBgQBX64cGscQkkZ+3STdVp/NK1kxgS0npdF/iX6KPedSug8iQR7\r\nwpO7AN0YmnjPBrXM6uVYZwy2LRTZq8A+jHB/9e0kFt9WRQEtpFUK5Hso3m55\r\n+cqyn56QTMw7LiHFWnV5BRKo0xlSHZzZ0N2/ZZTGnAgLFh5ZlSJQ/9zt+s+L\r\nKOT40TfjPnUhQd65xsUZ13+PXb1K7FzwyVzLTBVbSe5bXuvCpDRC5v+Hl0Q1\r\nXSQ6VFsudL562ERzsBxfNv5Y+xKtQTWdQRVyk3/06n2C/CBqKiZLq0mKGTb7\r\nS824qd8DNcTfnlkgz+eZ+oPqpYxncpRCmbo=\r\n=r4t4\r\n-----END PGP SIGNATURE-----\r\n","size":2232,"noattachment":false,"key":"/audio-type/-/audio-type-2.1.1.tgz"},"_npmUser":{"name":"dy","email":"df.creative@gmail.com"},"directories":{},"maintainers":[{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"hemanth","email":"hemanth.hm@gmail.com"},{"name":"dy","email":"df.creative@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/audio-type_2.1.1_1677816507677_0.1606451423494868"},"_hasShrinkwrap":false,"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":1677816507858,"_cnpm_publish_time":1677816507858,"dist-tags":{"latest":"2.8.0"}}