Skip to content

MisterAlex95/react-native-record-sound

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-record-sound

[DEPRECATED]: I have to update the ObjC and Java code. And update RN version.

Installation

  • Install the module
npm i --save react-native-record-sound
  • In android/settings.gradle
...
include ':react-native-record-sound', ':app'
project(':react-native-record-sound').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-record-sound/android')
  • In android/app/build.gradle
...
dependencies {
    ...
    compile project(':react-native-record-sound')
}
  • Register module (in MainActivity.java)
import com.reactnativerecordsound.ReactNativeRecordSoundPackager;  // <--- import

public class MainActivity extends ReactActivity {
  ......
  @Override
  protected List<ReactPackage> getPackages() {
    return Arrays.<ReactPackage>asList(
      new MainReactPackage(),
      new ReactNativeRecordSoundPackager()  // <------ add here     
    );
  }
  ......

}

How to use

import Record from 'react-native-record-sound';
let isRecording = false;
...
recordSound() {
  if (isRecording === false)
    Record.startRecord(path + 'sound.mp4', (err) => {console.log(err)});
  else   
    Record.stopRecord();
  isRecording = !isRecording;
}

About

[DEPRECATED] react-native-record-sound

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published