https://github.com/qiuxiang/react-native-recording
React Native audio recording module used for DSP with Android + iOS
https://github.com/qiuxiang/react-native-recording
audio-recording react-native recording
Last synced: about 1 month ago
JSON representation
React Native audio recording module used for DSP with Android + iOS
- Host: GitHub
- URL: https://github.com/qiuxiang/react-native-recording
- Owner: qiuxiang
- License: mit
- Created: 2017-08-10T12:45:01.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-06-11T02:41:11.000Z (almost 2 years ago)
- Last Synced: 2025-03-30T17:11:23.533Z (about 2 months ago)
- Topics: audio-recording, react-native, recording
- Language: Java
- Homepage:
- Size: 441 KB
- Stars: 110
- Watchers: 11
- Forks: 64
- Open Issues: 23
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-native-recording [![npm version][version-badge]][npm]
React Native audio recording module used for DSP with Android + iOS
## Install
```
$ npm i react-native-recording
```## Usage
```javascript
import { PermissionsAndroid } from "react-native";
import Recording from "react-native-recording";await PermissionsAndroid.requestMultiple([
PermissionsAndroid.PERMISSIONS.RECORD_AUDIO,
]);Recording.init({
bufferSize: 4096,
sampleRate: 44100,
bitsPerChannel: 16,
channelsPerFrame: 1,
});const listener = Recording.addRecordingEventListener((data) =>
console.log(data)
);Recording.start();
// stop recording
Recording.stop();
listener.remove();
```## Microphone request for iOS 10 and above
As of iOS 10.0, you must declare an intention to access a microphone. Add *NSMicrophoneUsageDescription* key and declaration value in *Info.plist*.
```
...
NSMicrophoneUsageDescription
This app uses the microphone to record the soundscape.
...```
[npm]: https://www.npmjs.com/package/react-native-recording
[version-badge]: https://badge.fury.io/js/react-native-recording.svg