Picovoice/react-native-voice-processor
Picovoice/react-native-voice-processor has 49 GitHub stars and 5 forks. Star changes are not measured yet. Last checked 2026-11-11 04:06 UTC. Last push 2026-11-10.
React Native audio recording package designed for real-time speech audio processing
Measured star growth
- in 24h
- Update delayed
- in 7 days
- Update delayed
- in 15 days
- Update delayed
- in 1 month
- Update delayed
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginalReact Native Voice Processor
Made in Vancouver, Canada by Picovoice
The React Native Voice Processor is an asynchronous audio capture library designed for real-time audio processing on mobile devices. Given some specifications, the library delivers frames of raw audio data to the user via listeners.
Table of Contents
Requirements
- Node.js (16+)
- Android SDK (21+)
- JDK (8+)
- Xcode (11+)
- CocoaPods
Compatibility
- React Native 0.68.7+
- Android 5.0+ (API 21+)
- iOS 13.0+
Installation
React Native Voice Processor is available via npm. To import it into your React Native project install with npm or yarn:
yarn add @picovoice/react-native-voice-processor
or
npm i @picovoice/react-native-voice-processor --save
Permissions
To enable recording with the hardware's microphone, you must first ensure that you have enabled the proper permission on both iOS and Android.
On iOS, open the Info.plist file and add the following line:
<key>NSMicrophoneUsageDescription</key>
<string>[Permission explanation]</string>
On Android, open the AndroidManifest.xml and add the following line:
<uses-permission android:name="android.permission.RECORD_AUDIO" />
See our example app for how to properly request this permission from your users.
Usage
Access the singleton instance of VoiceProcessor:
import {
VoiceProcessor,
VoiceProcessorError
} from '@picovoice/react-native-voice-processor';
let voiceProcessor = VoiceProcessor.instance;
Add listeners for audio frames and errors:
voiceProcessor.addFrameListener((frame: number[]) => {
// use audio frame
});
voiceProcessor.addErrorListener((error: VoiceProcessorError) => {
// handle error
});
Ask for audio record permission and start recording with the desired frame length and audio sample rate:
const frameLength = 512;
const sampleRate = 16000;
try {
if (await voiceProcessor.hasRecordAudioPermission()) {
await voiceProcessor.start(frameLength, sampleRate);
} else {
// user did not grant permission
}
} catch (e) {
// handle start error
}
Stop audio capture:
try {
await this._voiceProcessor.stop();
} catch (e) {
// handle stop error
}
Once audio capture has started successfully, any frame listeners assigned to the VoiceProcessor will start receiving audio frames with the given frameLength and sampleRate.
Capturing with Multiple Listeners
Any number of listeners can be added to and removed from the VoiceProcessor instance. However,
the instance can only record audio with a single audio configuration (frameLength and sampleRate),
which all listeners will receive once a call to start() has been made. To add multiple listeners:
const listener1 = (frame) => { };
const listener2 = (frame) => { };
const listeners = [listener1, listener2];
voiceProcessor.addFrameListeners(listeners);
voiceProcessor.removeFrameListeners(listeners);
// or
voiceProcessor.clearFrameListeners();
Example
The React Native Voice Processor app demonstrates how to ask for user permissions and capture output from the VoiceProcessor.
To launch the demo, run:
yarn bootstrap
yarn example ios
# or
yarn example android
Releases
v1.2.0 - August 11, 2023
- Numerous API improvements
- Error handling improvements
- Allow for multiple listeners
- Upgrades to testing infrastructure and example app
v1.1.0 - February 23, 2023
- Migrated to new template
v1.0.0 - March 29, 2021
- Initial public release
Explore related projects
ytdl-org/youtube-dl
Command-line program to download videos from YouTube.com and other video sites
141,539 starsexcalidraw/excalidraw
Virtual whiteboard for sketching hand-drawn like diagrams
135,492 starsgodotengine/godot
Godot Engine – Multi-platform 2D and 3D game engine
120,003 starsmrdoob/three.js
JavaScript 3D Library.
118,122 stars