Skip to content

React Native Waveform RecorderVoice recording with a live native waveform

A Fabric view for iOS and Android that records audio, draws the waveform on the UI thread, previews and continues recordings, and hands you a file plus 64 bars ready for a chat bubble.

0:070:12

The recorder view on iOS: white waveform bars on a blue pill with a 0:07 timer

Install ​

sh
npm install react-native-waveform-recorder
sh
yarn add react-native-waveform-recorder
sh
npx expo install react-native-waveform-recorder
npx expo prebuild

Then run npx pod-install for iOS and add a microphone usage description. See Installation for permissions, background recording and the Expo config plugin.

Record a voice note ​

tsx
import { useRef } from 'react';
import { Button, View } from 'react-native';
import {
  WaveformRecorderView,
  type WaveformRecorderViewRef,
} from 'react-native-waveform-recorder';

export function VoiceNote() {
  const ref = useRef<WaveformRecorderViewRef>(null);
  return (
    <View>
      <WaveformRecorderView
        ref={ref}
        style={{ height: 56 }}
        onComplete={(e) => console.log(e.uri, e.durationMs, e.samples)}
      />
      <Button title="Record" onPress={() => ref.current?.start()} />
      <Button title="Stop" onPress={() => ref.current?.stop()} />
    </View>
  );
}

Play it back with the sister library ​

react-native-waveform-player draws the same kind of pill for playback. Pass onComplete.uri and onComplete.samples to it and the player skips decoding the file. See Export and the player.

Released under the MIT License.