{"name":"audio-type","version":"2.2.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":"5f5a2f6dca57dc249ea7fc152008a4be3e8bd2ff","bugs":{"url":"https://github.com/audiojs/audio-type/issues"},"homepage":"https://github.com/audiojs/audio-type#readme","_id":"audio-type@2.2.1","_nodeVersion":"18.9.1","_npmVersion":"8.19.1","dist":{"integrity":"sha512-En9AY6EG1qYqEy5L/quryzbA4akBpJrnBZNxeKTqGHC2xT9Qc4aZ8b7CcbOMFTTc/MGdoNyp+SN4zInZNKxMYA==","shasum":"5ceae0b0b3cf3b1e117edabb9e5332eaf3bd4f25","tarball":"http://registry-npm.ywwl.com/audio-type/download/audio-type-2.2.1.tgz","fileCount":4,"unpackedSize":5090,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCIOGfjlU1DQVUZ9y20UmKn79PB6DRr66AAEMFCp4WkuAIgNmzI70kpg/pYs0XcjR8nvQXZp5XNu4GCAcGCiaAvlcw="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkAlJhACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoM7A//WCuO6YsyRQN4RzPutKeSj0U2QF4E5LECjH1ePr74DUzFWqgO\r\n/d4w02QaFRq5DwHfnBA3RBdUj25TWKe+vAgxlBeTvGceiGb7Wb2syPmPSnlk\r\nMYBHpgo9uBXuXe4Nzd5hTvLjEtFeAk9Fmb7+7v/deSGNP3SlVurlz6lEqRUk\r\n66lEHe9yeIn6fBmi346BN/Rh+D+yfb/AarH0GvFEjChoxBSaaxGD5Gjsww1z\r\nVviY9ZaJI0mPVpAx6PDBmWOcyhcUqHNmcZ0fqTyFUDxAMVCz6mzeC5nvKAQi\r\ntth9qHtt1wK76HxcbkAAimdqxnDJlgmoB51mh44DYk/4Uk9oFgjTcoJLGDsy\r\nIG+BE5kCVXbhb9e5GIqvNrW9SQ61CG1K24QjevK1YG+dABHvqmCrY2/1xX0m\r\n8sV5xKOtaotn00Z17DluLRO5hWp/dCLT32hxYNDKANv0cC15qMH34+tGxL3h\r\nBest2Y1mCHPgv5GtM2I6o1td0ODeXOys5WKqlbC+GuAB6mK4Thf8b3kIP1bs\r\nsgq90oWhu/W/W0+FiOkzImMtMGBg2lt472mckAs0N32gRcn/prNOop+b1fVK\r\nKMghBvPnIjoWecHweUMyHc/KRI+OqWKh+VvZrqHQnxJJbQ43mMyU1bojK49H\r\nlFOgyAGno3IGWLZG/Oh1aPNqE/e/xMvWD3o=\r\n=oCmU\r\n-----END PGP SIGNATURE-----\r\n","size":2277,"noattachment":false,"key":"/audio-type/-/audio-type-2.2.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.2.1_1677873760968_0.2962544910369078"},"_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":1677873761118,"_cnpm_publish_time":1677873761118,"dist-tags":{"latest":"2.8.0"}}