{"name":"audio-type","version":"2.0.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":"f845f981d2644646ed03c186e8793cc7021a70a5","bugs":{"url":"https://github.com/audiojs/audio-type/issues"},"homepage":"https://github.com/audiojs/audio-type#readme","_id":"audio-type@2.0.0","_nodeVersion":"18.9.1","_npmVersion":"8.19.1","dist":{"integrity":"sha512-1uc3zLzUlo4lm6HYQqP0UNgfWaMYjOxgiYEYd474vAAW3hOHH4m/12I/hp5mPeux0P/AoBfnQpyAKDKiQfg6tw==","shasum":"a6544aae1752e1d75a534dae64538ef16179c458","tarball":"http://registry-npm.ywwl.com/audio-type/download/audio-type-2.0.0.tgz","fileCount":4,"unpackedSize":4274,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDH/GjOuJz3l0GWtHNPtGXKzFUY7WS7JYwX1XNk7keNWgIhALgBwjZJm3oO2QdEcxrIqlg6C2KRUPzvz9kSxF1EbIx6"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkAMk3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrfpA/+Kg9GdBdgqrpffqahwvAHQOfuiTp7bJoXMxknXP4Ci9qfnIxa\r\nzoktIGq86AqIv8zZQgH0v+xeVQALnm5M+lKHQrBnfDcaZnQDen7ZBp3AAnxZ\r\niaCV/pyvZZXjJsC8IKzBZ4AaYLdXJarCc/XkD67pnJfP4ws4RkGXgzK8O6ZM\r\nKpGun5DW4MPgKOoSVH1Xr6s7YwNxVsvxkoYVfmHNoLJIDIrXyWRX2QAmIVn2\r\nyHRleaIGF4A1JL4z08b07sdFFPAWMA+srpUIMSMgmhHW8Zcpatlrm+krsQj2\r\nSkjUrKt1AB65zgBGXh7kDFliBlVd7ylmCRr/+ZJpl+4EhZNabpWpCK7q14c9\r\nZY9/kXTz2AOUe71eVVqWjuj1pssTtxnqnvfk1oVMO2fDEb3WFoVw6PZe03LY\r\n0o0P8aNgiRIaI3aG5QJxVcve0DTcWEtYQmhFGhZPLgPevHLaB22XFrjcmlBI\r\nCQGfkrFWqRMDuhccvIqQ/PwXJbwSMt+9DJwpeI42eH+1HpermEIaMB5oks6y\r\noyBKD1dGbAH4CA/Z+fHDPQJ11NIVCSw04aA33IWqZ+y4MvBCprHWW/Q+Ph3x\r\npSLjlpquLdKadBSOSA3HvPOtbf+Kq3ZUaVkp5PojvFgpJcaZ6igEM6qanjVt\r\nZzH5ALW2bqsaXQhqoIdadYESVjzhHsZ2jjU=\r\n=eGNe\r\n-----END PGP SIGNATURE-----\r\n","size":2061,"noattachment":false,"key":"/audio-type/-/audio-type-2.0.0.tgz"},"_npmUser":{"name":"dfcreative","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.0.0_1677773111362_0.8387938707433242"},"_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":1677773111515,"_cnpm_publish_time":1677773111515,"dist-tags":{"latest":"2.8.0"}}