Add useMicrophone hook
Is your feature request related to a problem? Please describe. Accessing the microphone in React requires verbose boilerplate ā handling permissions, creating MediaStream, managing cleanup, and dealing with browser quirks.
Describe the solution you'd like
Add a useMicrophone hook:
const { stream, granted, error, start, stop } = useMicrophone({
constraints: { audio: true },
});
start() requests permission and begins capture.
stop() stops and releases the mic.
stream is the live MediaStream.
Automatically cleans up on unmount.
Describe alternatives you've considered Manual getUserMedia usage or small third-party hooks ā both repetitive and less reliable.
I would love to implement the hook if you believe it's a good fit for the library.
Hi! Iād like to work on implementing the useMicrophone hook. Please let me know if I can take this up.