react-use icon indicating copy to clipboard operation
react-use copied to clipboard

Add useMicrophone hook

Open lizozom opened this issue 5 months ago • 1 comments

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.

lizozom avatar Oct 24 '25 18:10 lizozom

Hi! I’d like to work on implementing the useMicrophone hook. Please let me know if I can take this up.

Shahab-16 avatar Dec 17 '25 18:12 Shahab-16