1.0.2 ā¢ Published 1 year ago
react-use-microphone-volume-hook v1.0.2
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.