npm

Need private packages and team management tools?Check out npm Orgs. »

react-native-loudness

1.0.6 • Public • Published

react-native-loudness

Read microphone loudness in React Native

Getting started

$ npm install react-native-loudness --save

Mostly automatic installation

$ react-native link react-native-loudness

Required Additional Steps

iOS

  1. In Info.plist, add Privacy - Micronphone Usage Description using XCode.

Android

  1. In AndroidManifest.xml, add <uses-permission android:name="android.permission.RECORD_AUDIO" />.

Permission

For Android, you have to request permission in the code. Please refer to PermissionsAndroid for more details. Example App also demonstrates the permission request process in Android. The example App has not been tested on IOS.

Usage

Loudness is in dbFS from -160 to 0, where -160 represents absolute silence and 0 represents the maximum loudness the microphone can sense.

import {Loudness} from 'react-native-loudness';
 
const loudness = new Loudness();
loudness.start();
 
loudness.getLoudness((loudness) => {
  console.log(loudness);
});
 
loudness.stop();

install

npm i react-native-loudness

Downloadsweekly downloads

3

version

1.0.6

license

Apache-2.0

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability