What is react-native-waveform-recorder?
react-native-waveform-recorder is a React Native view that records audio from the microphone and draws a live waveform while it records. It is the recording half of a voice-message feature: the user records, optionally listens back and keeps going, and you get a finished audio file together with a 64-bar summary of its loudness for the chat bubble.
Everything that runs per frame is native. The microphone level is read in Swift (AVAudioRecorder) and Kotlin (MediaRecorder or AudioRecord), and the bars are drawn by a native view. JavaScript only sends commands through a ref and receives events.
Features
| Feature | Where |
|---|---|
| Live waveform with configurable bars, colors, timer and placeholder ticks | Props |
| Pause and resume, preview with scrubbing, continue recording after preview | Segments, pause and preview |
| Slide to cancel and slide to lock | Slide gestures |
| Event after a quiet stretch, optional automatic stop | Silence detection |
m4a, aac, wav and opus output, 64 bars for a chat bubble | Export and the player |
| 16-bit PCM chunks while recording | PCM stream |
| Recording in the background | Platform notes |
Platforms
| Support | |
|---|---|
| iOS | Yes (Swift, AVFoundation). Minimum version follows your React Native release. |
| Android | Yes (Kotlin), API 24 or later. opus output needs API 29. |
| New Architecture (Fabric) | Required. There is no Old Architecture implementation. |
| Expo | Development builds and expo prebuild, with a config plugin. Not Expo Go. |
| Web | No. Rendering the view on web throws an error. |
The library has no JavaScript dependencies besides React Native itself.
How it fits together
- Render
<WaveformRecorderView>with a height in itsstyle, for exampleheight: 56. - Call
ref.current?.start()from your record button. The library asks for microphone permission first. - While recording, the view draws bars and fires
onMeter. You canpause(),resume(),enterPreview()to listen back, orcancel(). - Call
stop(). The view finalises the file and firesonCompletewith itsfile://URI, duration, size, format and 64samples. - Show the result with react-native-waveform-player, passing the URI and the samples.
Keep the file before you cancel or unmount
cancel() and removing the view from the screen delete the session's recording files. For a recording without a preview-and-continue step, that includes the file onComplete gave you. Copy or move the file in onComplete if you need it later. See Export and the player.
Next steps
- Installation: permissions, background recording and the Expo config plugin.
- Quick start: a working record, preview and send screen.
- Browser demo: try the props and events with your own microphone.