reactjsaudio-recording

How to record audio in React


First, I tried MediaRecorder API to record audio clips but the output files have some issues. Then I tried different libraries such as react-audio-voice-recorder, react-mic, ...etc. But they also gave me the same output.

Issues I face:

  1. The output file doesn't have a length value (therefore audio players don't show the timeline correctly).
  2. Output files are played on Android phones but not on iPhones.

This example of React-Mic-Gold gives the output I want but, it has announced that React-Mic-Gold no longer supporting

I would appreciate anyone with experience implementing an audio recorder in React here.


Solution

  • I fixed the issues mentioned above and created an npm package to simplify usage. If anyone is facing the same issue, please try this out.

    react-use-audio-recorder