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:
- The output file doesn’t have a length value (therefore audio players don’t show the timeline correctly).
- 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.
2
Answers
I was able to fix the issues I mentioned above. I published a npm package so if any are facing the same problems I encountered, You can try this.
react-use-audio-recorder
You can refer to this raw code from one of my portfolio used with React, typescript and Tailwind UI