Skip to content

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 ​

FeatureWhere
Live waveform with configurable bars, colors, timer and placeholder ticksProps
Pause and resume, preview with scrubbing, continue recording after previewSegments, pause and preview
Slide to cancel and slide to lockSlide gestures
Event after a quiet stretch, optional automatic stopSilence detection
m4a, aac, wav and opus output, 64 bars for a chat bubbleExport and the player
16-bit PCM chunks while recordingPCM stream
Recording in the backgroundPlatform notes

Platforms ​

Support
iOSYes (Swift, AVFoundation). Minimum version follows your React Native release.
AndroidYes (Kotlin), API 24 or later. opus output needs API 29.
New Architecture (Fabric)Required. There is no Old Architecture implementation.
ExpoDevelopment builds and expo prebuild, with a config plugin. Not Expo Go.
WebNo. Rendering the view on web throws an error.

The library has no JavaScript dependencies besides React Native itself.

How it fits together ​

  1. Render <WaveformRecorderView> with a height in its style, for example height: 56.
  2. Call ref.current?.start() from your record button. The library asks for microphone permission first.
  3. While recording, the view draws bars and fires onMeter. You can pause(), resume(), enterPreview() to listen back, or cancel().
  4. Call stop(). The view finalises the file and fires onComplete with its file:// URI, duration, size, format and 64 samples.
  5. 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.

Released under the MIT License.