{"name":"audio-type","version":"2.1.0","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":"74d64059903c79925608893a930b5c64dce043ae","bugs":{"url":"https://github.com/audiojs/audio-type/issues"},"homepage":"https://github.com/audiojs/audio-type#readme","_id":"audio-type@2.1.0","_nodeVersion":"18.9.1","_npmVersion":"8.19.1","dist":{"integrity":"sha512-tRI0Tohe85ga/2yQrw+tuiAD4UCW/9xd43Dig3EGiu585Svc+xfmHjaQtuOH54rjwJ5eIsZtJWIpah/bjKH+1Q==","shasum":"e9e5d63f7748de9c13d59bbfa7a7292dc1d15b25","tarball":"http://registry-npm.ywwl.com/audio-type/download/audio-type-2.1.0.tgz","fileCount":4,"unpackedSize":4866,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCPlU2S1oo2I/VawapZr/gNqStr4zWcqQvsW5/20BhGLwIgaeG2k+0TVG7f0sWh6bMaBAaTJx09nEIysHnM6XtOSDo="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkAW6YACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq1OA//aIparI/NdS01o0aRA0iA/BJZJ0zGt0gcu4g/W6wpQg4KTgAI\r\nM5aYRRqdJynEOrP/CLOqOch+H9ZyVqxRdf/WsDb5yYZb9dj6ltbAN3CKRTQX\r\nFaEJFG0OeYdsnyOnIlUIt1RDtY4vnqy7/Ri3M0j3sMh8mVvf+GpTUBdC/eq6\r\nzVm3SE2hkugc/XbCmrd33hlIi32lVTVi121dMg/SfnUcUlQdYfJRsKvlzPf/\r\nZDYsQHU2g+MPrXfheQbBDymEhnUjEXwz6zGJihY7oWtLN2z5t3OEWxmuVIn9\r\nL6edstHNiSSpj+BpcRACqFJVog3gJ2pWT/f8RMqd51lcj9idxirfq0/eQa39\r\nIm9Uz4Mz/ytsCIQUyDGCgoywzxdXQz3/Yz1Gt9WBJmvz2oE8L4ofqZTYZqBg\r\nhQdyLDkeMe3qx+7EFvru/xyMLcePmtAKM4iE3h8fZOMBxKBRjXPYVPKr24i8\r\nv8t/nMteWagIX6wKr05WScOa9VrrdrXKobQQWoVR0Mh53DaqzxNmr8PHhdNO\r\ndD/Hb9q5FcBBrmyhKgssyI7HJqwb4snloZx5rl4m5hJmkk7457e8NNs5pb6j\r\nElF6B+OA6yKvgBZFJtsEjj2J32ELBzRU+ZMANP0DEnYHib2Hj6VTcMhjgwRn\r\nICsaB6XDHFI18m6HB+KFsaCaTF0HLFGTFFo=\r\n=7Xwt\r\n-----END PGP SIGNATURE-----\r\n","size":2210,"noattachment":false,"key":"/audio-type/-/audio-type-2.1.0.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.0_1677815448380_0.7768927378789356"},"_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":1677815448542,"_cnpm_publish_time":1677815448542,"dist-tags":{"latest":"2.8.0"}}