{"_id":"@adrianhurt/mic-volume-meter","_rev":"2-27dd22b9b8627b235929a6bab644a41f","name":"@adrianhurt/mic-volume-meter","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@adrianhurt/mic-volume-meter","version":"0.1.0","description":"A simple way to measure the microphone volume meter","author":{"name":"adrianhurt"},"license":"MIT","main":"lib/index.js","keywords":["mic","microphone","volume","audio","meter","js"],"scripts":{"clean":"rm -rf lib","clearAll":"yarn clean && rm -rf node_modules","reinstall":"yarn clearAll && yarn install","test":"jest --passWithNoTests","lint":"eslint index.js src","validate":"yarn test && yarn lint","prebuild":"yarn clean","build":"npx babel src --out-dir lib --ignore '**/*.test.js'","dist":"yarn validate && yarn build","prepublishOnly":"yarn dist"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"yarn validate"}},"devDependencies":{"@babel/cli":"^7.8.4","@babel/core":"^7.9.0","@babel/preset-env":"^7.9.5","@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","babel-eslint":"^10.1.0","babel-jest":"^25.3.0","eslint":"^6.8.0","eslint-config-airbnb":"^18.1.0","eslint-config-airbnb-base":"^14.1.0","eslint-config-prettier":"^6.10.1","eslint-plugin-import":"^2.20.2","eslint-plugin-jsx-a11y":"^6.2.3","eslint-plugin-prettier":"^3.1.2","husky":"^4.2.5","jest":"^25.3.0","prettier":"^2.0.5"},"gitHead":"073a385916662d5a611c42b3938d2f649ff5c08b","_id":"@adrianhurt/mic-volume-meter@0.1.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.1","_npmUser":{"name":"adrianhurt","email":"adrianhurt@gmail.com"},"dist":{"integrity":"sha512-XYiG5ZU9HiX0FFowKCPZP55qiV5kDasBv1g2SQgXLXCiK21TvteGQK7+iFBo9WmrtVMqvhuSIdLH1XaflmEdFw==","shasum":"3fa4271b102b78f0f184adfaa8d84fe15b04ba19","tarball":"https://registry.npmjs.org/@adrianhurt/mic-volume-meter/-/mic-volume-meter-0.1.0.tgz","fileCount":7,"unpackedSize":264835,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe2CNtCRA9TVsSAnZWagAA15MP/3wvBFIA/ubSUDXQEa1e\n4l6kc9yB2r+8+PTSLGogPu3zwt4SG9dN5tpzFMfJqEejRU7SUNYYO97QbA7k\nGE60Pk0VOINUh+sc6ejLCIF9BLbIoOQSQVCcQGbVgFdQl7qrxl+r8ZCNFZwO\nJS9eLfVpkm0jP3/7PybrHPerdYT1r9vFYWhlOUChhwMApkkVChXrY7QtuH/T\ndJ+yCvjJV6FfFmPD24RXLG9Xn5Np1PDhXVd0Ipl1KFZIJs1fiN+QcE4c8JkY\n8Y907nAD0crtKNle67skKni7ysZ3sR+oesfDNuxMwOqxU7jUPVbCTYPt1En1\n+ams+P9VX+Lenek0EpV763XOqP0GJq0XvSuMbqQ5GCiK2lsyocmiBh5GcgoW\nNLNnqPFCKgSml9Dfo5HU21PqgfiEyOpBIBB0JZI4FAfJfH3ieDj5mZkyWocf\n0R37BNE9YV1sIjsglluNvUsV4iRA9x1BWrQp6nEzPM1TJd0pwtOOJb8UpJd8\nEu2tElkm0mOhBEQ6RQ+TGCjFBgECpbpCjlH6GRR4E+z6lTFDvxiOXd6zcnO6\nAg9FscO2mAZznW0Jsn0xGvlbb9SIlDcUMNziC5cGcG6VSkus9Id3zdW85Ckt\nQTz/iToY9/nR2TMPqEEhsNy+W0UFfnL+uEWfIOfefUNNddoON6HGack+aCYu\nlVKz\r\n=mpMo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGu97y816wEpm7KdxuViHW0LetPTzsa55fbf3PyH0GvSAiA4fLcuz33Dw91aLqQGCAvS+eDCKk2jNThwV3ZFGALSQA=="}]},"maintainers":[{"name":"adrianhurt","email":"adrianhurt@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mic-volume-meter_0.1.0_1591223148561_0.9879744307693692"},"_hasShrinkwrap":false},"0.1.1":{"name":"@adrianhurt/mic-volume-meter","version":"0.1.1","description":"A simple way to measure the microphone volume meter","author":{"name":"adrianhurt"},"license":"MIT","main":"lib/index.js","keywords":["mic","microphone","volume","audio","meter","js"],"homepage":"https://github.com/adrianhurt/mic-volume-meter","repository":{"type":"git","url":"git+https://github.com/adrianhurt/mic-volume-meter.git"},"scripts":{"clean":"rm -rf lib","clearAll":"yarn clean && rm -rf node_modules","reinstall":"yarn clearAll && yarn install","test":"jest --passWithNoTests","lint":"eslint index.js src","validate":"yarn test && yarn lint","prebuild":"yarn clean","build":"npx babel src --out-dir lib --ignore '**/*.test.js'","dist":"yarn validate && yarn build","prepublishOnly":"yarn dist"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"yarn validate"}},"devDependencies":{"@babel/cli":"^7.8.4","@babel/core":"^7.9.0","@babel/preset-env":"^7.9.5","@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","babel-eslint":"^10.1.0","babel-jest":"^25.3.0","eslint":"^6.8.0","eslint-config-airbnb":"^18.1.0","eslint-config-airbnb-base":"^14.1.0","eslint-config-prettier":"^6.10.1","eslint-plugin-import":"^2.20.2","eslint-plugin-jsx-a11y":"^6.2.3","eslint-plugin-prettier":"^3.1.2","husky":"^4.2.5","jest":"^25.3.0","prettier":"^2.0.5"},"gitHead":"ff3ebd66f9f034106a7d8503fc0dbf0089006017","bugs":{"url":"https://github.com/adrianhurt/mic-volume-meter/issues"},"_id":"@adrianhurt/mic-volume-meter@0.1.1","_npmVersion":"6.4.1","_nodeVersion":"10.15.1","_npmUser":{"name":"adrianhurt","email":"adrianhurt@gmail.com"},"dist":{"integrity":"sha512-EadRww5DlTlt/kSrSZXzxD6gxuqhGZ/lGMpMc+ZUnBRCVKNTYaYXxbDdNUr1kLEBhlwMXlwP8BErFGHNd7Lofw==","shasum":"498cb0a01ce5300f319bbc6aed1d923cad6f6ac7","tarball":"https://registry.npmjs.org/@adrianhurt/mic-volume-meter/-/mic-volume-meter-0.1.1.tgz","fileCount":6,"unpackedSize":11520,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe2JgkCRA9TVsSAnZWagAAf5UQAKIUGI4TJMKcFKzCPbo6\n/5n4Z3pGArudN+4QITg7nJrxpMNC4SV2zt3SaPJFellTCqaVttkJwYiwZMoT\neMkIdZtZSJ86OM1Saf07AvUwysliq+oTr0TqyJnWiaatMG0WZrzYTaLnLHjU\nSAKcn+62xAwXD2qfSFMN9uE2V2jjByw5myb3LdtHpEAGXbUUEvWNZc155di0\nwlcBu1VSPvQasjQcFUDPHy3/IM/olTrQshSHbd8SXXtWHNVKauxjCzn9lDZW\nmktuTNz/82jIDwHtPeal6nrmqYLXpwrv2t04wmI7d2y4iIQwnlBLgSK9O+AM\nf9McLM8pPhR3NQv5tmfvBUhbiUY9Ao3t3kT6wHVAvZtP82ZDbDW4FWUrBJy+\novYLme9NJnh6vGmIOlSVPArBk8rrwV4B6EFE4VfDIIliKBasBFhlwuxqBj8w\nXFRXbSOBiJ3w8QPqit7o08wWw3DVVuEFV7IC81Yg6HIw+Hsb4qL/ZhmiygaC\nO2AgJfFVYQe76jZ8j9kKBsPhF3IyHD10t+9TuKeVWZOuIrXSgl6tYO6UQrTi\n0wz3xh7VKnmI6vAZ7O9SYbcCIwzHnKiKq6LiU0e19E5RsONQqlOzQAFTLlNb\nAe2q6m+eGR9HvkneM4eaCl5jSIWq0T/U3ebHc6o2x/C782vXNn4Lz553/SNG\nGHMp\r\n=BmAy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCUTxFyE6oG+0gOqu6Y/9avTFWci1GXjRgCRlCyrpw1cwIgVhA3v7QeovEGQWOc4BI0xmhTnYz9BCK0NQ7/BBShP3Y="}]},"maintainers":[{"name":"adrianhurt","email":"adrianhurt@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mic-volume-meter_0.1.1_1591253028346_0.36522352683615456"},"_hasShrinkwrap":false}},"time":{"created":"2020-06-03T22:25:48.524Z","0.1.0":"2020-06-03T22:25:48.700Z","modified":"2022-04-04T11:37:15.247Z","0.1.1":"2020-06-04T06:43:48.568Z"},"maintainers":[{"name":"adrianhurt","email":"adrianhurt@gmail.com"}],"description":"A simple way to measure the microphone volume meter","keywords":["mic","microphone","volume","audio","meter","js"],"author":{"name":"adrianhurt"},"license":"MIT","readme":"# @adrianhurt/mic-volume-meter\n\n`MicVolumeMeter` allows you to retrieve the microphone's volume with a given interval.\n\nFirst of all, thank to [Chris Wilson's repository](https://github.com/cwilso/volume-meter) that serves as the core for this one.\n\n## Install\n\n```\n$ npm install @adrianhurt/mic-volume-meter\n```\n\nor\n\n```\n$ yarn add @adrianhurt/mic-volume-meter\n```\n\n## Usage\n\n```js\nimport MicVolumeMeter from '@adrianhurt/mic-volume-meter'\n\nconst volumeMeter = new MicVolumeMeter()\n\nfunction onNewMeasure ({ volume, time }) {\n    console.log(volume, time) // volume from 0 to 1 and time in millisecs from the start time\n}\n\nfunction stop () {\n    volumeMeter.stop() // stop the MicVolumeMeter whenever you want\n}\nfunction switchOff () {\n    volumeMeter.switchOff() // switch off the MicVolumeMeter whenever you want\n}\n\nvolumeMeter.switchOn() // switches on the MicVolumeMeter\n    .then(() => {\n        // starts the MicVolumeMeter that will call onNewMicVolumeMeasure each 100 milliseconds\n        volumeMeter.start({ onNewMeasure: this.onNewMicVolumeMeasure, interval: 100 })\n    })\n    .catch(() => alert('Permission denied!'))\n```\n\n## MicVolumeMeter\n\n### Methods\n- `switchOn({ clipLevel, averaging, clipLag })`: returns a promise after requesting mic permissions and switching on the MicVolumeMeter.\n    It is rejected if the user denies the mic permissions. Please, check [Chris Wilson's repository](https://github.com/cwilso/volume-meter/blob/master/volume-meter.js) to know\n    how to use the `clipLevel`, `averaging` and `clipLag` options.\n- `start({ onNewMeasure, interval })`: starts the MicVolumeMeter and call `onNewMeasure` callback periodically (with the given `interval` in milliseconds).\n    `onNewMeasure` callback will be called with an object as argument with this structure: `{ volume, time }` (volume will be a number from 0 to 1 and time in millisecs from\n    the start time).\n- `stop()`: stops the MicVolumeMeter.\n- `switchOff()`: stops (if it was active) and switchs off the MicVolumeMeter.\n- `checkClipping()`: please, check [Chris Wilson's repository](https://github.com/cwilso/volume-meter/blob/master/volume-meter.js) to know more about clipping\n\n### Properties\n- `isActive` (readonly): Boolean to know if MicVolumeRecorder is active or not (it's actived when you switch it on and deactivated when you switch it off).\n- `volume` (readonly): Number from 0 to 1 with the current mic's volume.\n- `startAt` (readonly): Number in milliseconds elapsed since January 1, 1970 00:00:00 UTC (with `Date.now()`).\n- `meter` (readonly): the inner meter object gotten with [Chris Wilson's repository](https://github.com/cwilso/volume-meter/blob/master/volume-meter.js).\n","readmeFilename":"README.md","homepage":"https://github.com/adrianhurt/mic-volume-meter","repository":{"type":"git","url":"git+https://github.com/adrianhurt/mic-volume-meter.git"},"bugs":{"url":"https://github.com/adrianhurt/mic-volume-meter/issues"}}