react-use-microphone-volume-hook
v1.0.2
Published
A React hook to subscribe to microphone volume changes
Downloads
42
Readme
Welcome to react-use-microphone-volume-hook 👋
A React hook to subscribe to microphone volume changes
🏠 Homepage
✨ Demo
Install
yarn install react-use-microphone-volume-hook
npm install react-use-microphone-volume-hook
Usage (Snippet)
"use strict";
import useMicrophoneVolume from "react-use-microphone-volume-hook";
// use hook with manual volume tracking
const [volume, { startTrackingMicrophoneVolume, stopTrackingMicrophoneVolume }] = useMicrophoneVolume();
// use hook with auto volume tracking
const [volume, { startTrackingMicrophoneVolume, stopTrackingMicrophoneVolume }] = useMicrophoneVolume({ autoStart: true });
// stop volume tracking
stopTrackingMicrophoneVolume(); // returns true on success, false on error
// manually start volume tracking
startTrackingMicrophoneVolume(); // returns true on success, false on error
// use volume
<div>Volume: {volume} </div>;
Please check here for a sample usage
Author
👤 Emmanuel Ibikunle
- Github: @shinnida220
- LinkedIn: @nuelibikunle
Show your support
Give a ⭐️ if this project helped you!
License
This software is released under the [MIT License].