1.0.6 • Published 6 years ago

rnsaveaudio v1.0.6

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

NDART LOGO

NDART

http://ndart.ca

RNSaveAudio Module

React-Native Home Useful Links Custom Module Tutorial

Purpose

The purpose of this module is to take an array of int16 data from javascript, and create a .wav file from that data, on Android and iOS devices natively. This module is essentially suppose to provide a sink when working with the react-native-recording module (https://www.npmjs.com/package/react-native-recording). More information can be found on the projects respective github homepage page -> https://github.com/qiuxiang/react-native-recording#readme...

Installation

Android

1) To install, run npm install rnsaveaudio 2) Edit /android/settings.gradle and add the following lines...

include ':rnsaveaudio'
project(':rnsaveaudio').projectDir = new File(rootProject.projectDir, '../node_modules/rnsaveaudio/android')

3) Edit /android/app/build.gradle and add the following line inside of dependencies...

compile project(':rnsaveaudio')

4) Edit /android/app/src/main/java/.../MainApplication.java with the follow lines...

  • Import the module at the top of the file
import com.navraj.rnsaveaudio.RNSaveAudioPackage;
  • Instantiate the package inside of the getPackages() method
new RNSaveAudioPackage()

5) run the command cd android && gradlew clean && cd ../ for windows, or cd android && ./gradlew clean && cd ../ for OSX, inside the root directory of your react-native project

iOS

1) Open your xCode project and add the RNSaveAudio.xcodeproj file to your project 2) Go to your project's build phases, and add the libRNSaveAudio.a file to the list labeled Link Binary With Libraries, using the + under the list

Notes

  • Version 1.0.6 is current
  • Works on Android and iOS (Tested)
  • Sends a promise when complete
  • Creates a .wav file based on an array of signed short (SInt16) values at a frequency of 44.1kHz
  • Meant to work with react-native-recording node package and react-native-fs package

Useage

  • Import the module using import RNSaveAudio from 'rnsaveaudio';
  • Export audio using RNsaveAudio.saveWav(PATH+'/filename.wav',dataArray);
  • Make sure to include the keywords await and async if used inside of a function, eg. async func(prop){ const variable = await RNsaveAudio.saveWav(PATH+'/filename.wav',dataArray); }

Contact Information

Other Information

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago