{"name":"audio-type","version":"2.2.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":"5d993fdc3b1c25c65b8853928b38f42b66d1edda","bugs":{"url":"https://github.com/audiojs/audio-type/issues"},"homepage":"https://github.com/audiojs/audio-type#readme","_id":"audio-type@2.2.0","_nodeVersion":"18.9.1","_npmVersion":"8.19.1","dist":{"integrity":"sha512-bH8wD3Db+knpEgXqsVWLciFCHMkeU1JQHF5alkSkTbsxDMRZQ7EsTFUy+9HXujZ9g0/8u0QxDxXb2FFh9y8gQw==","shasum":"d18dbfd8cfe120178957f9455069d4f3e2780130","tarball":"http://registry-npm.ywwl.com/audio-type/download/audio-type-2.2.0.tgz","fileCount":4,"unpackedSize":5071,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCjBSO8RGSMyglfXafVMsMFgxAq6C0r5ONdT6ITFgZU2wIgEZpD4vzOURrbr31mo9uUvffMvNOSxKB74I978/OcMks="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkAlARACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqbqg//UloZQqnXtzkg8UxN13AScM5bIM7Fprnj6tySC8OKwFnzkUYw\r\nFxmX5CY6Jwe3H71rah27+TnEZts/EU0cc75Ri5sd4oHuO268wVwE17lojHGF\r\nScXTxSG86RSrCCnCSzbs2c+tmEgsMQt7CAjvekT1gUe+OF87Thcw/T028yYA\r\nwM/ZUitDjY7M88ufie09fjf6IfUsvy4ovP2WIafJbqPd0TCa1gD6eG1SzpZ/\r\ntRdk24Xvu0LjiRJXiqZXOIY7wca36bzJV9ZVy1Uw4GhhRGnhKMyAdxC0Znan\r\nG9dVK14ESu/iuJBvTZoDySf4dizpzV8zf+7Ma61+WlbFbEZHWBulkZIqj/V4\r\nwJmufJDL4pxFVkgUXQeTj6XUOJaZdb3tcu8S1HomImgTykyT1b9C5OKHz7kq\r\nQ7S9zQwjky5zdfmjiP0ah3ikPL04VyVY+9FSxS8jwh4bDADCdNmJvgnUqmf9\r\nWwPuma+JGapQRTNJ+r+XuWbwuQclltTVVuUa8nBempxvOoeeRyejNaVTN9Tm\r\nAuVSLKmDJhwiFkpc/xA6nCGVkXIG4EIU/puFH3YVCb54528avvAdRON17cOE\r\nWJaaV0eN6WA75lbRN0aHIaXE6lt3FjkTBjtwVVuZLiJH35CW1oiQchM/5y79\r\nuYND96kvyaWkc6KOVq0xp+wLOukWT5itUJ4=\r\n=5coF\r\n-----END PGP SIGNATURE-----\r\n","size":2265,"noattachment":false,"key":"/audio-type/-/audio-type-2.2.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.2.0_1677873169045_0.39107413328957175"},"_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":1677873169226,"_cnpm_publish_time":1677873169226,"dist-tags":{"latest":"2.8.0"}}