0.0.72 • Published 6 years ago

react-native-sound-recorder-no-native v0.0.72

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

React Native Sound Recorder (No Native)

A simple drop in sound recorder component for react native applications.

This module makes extensive use of the Expo.io Audio SDK located here. It includes a sensible set of audio setup defaults, but can be customised using the information contained in the expo.io documentation.

npm npm npm npm

Why Use This?

This module is useful if you need a drop in sound recording component for an application in which using platform specific native code is prohibited; for example an application created using expo.io.

Why Not Use This?

You are not restricted from using native code, and can find a better module to use.

Installation

npm install --save react-native-sound-recorder-no-native

Usage

import SoundRecorder from 'react-native-sound-recorder-no-native';

Example

 <SoundRecorder
    style={{ flex: 1 }}
    onComplete={this.soundRecorderComplete.bind(this)}
    maxDurationMillis={150000}
    completeButtonText={'Finished'}
/>

This component accepts the following props:

NameTypeDefaultDescription
onComplete (required)functionnonecallback function executed when the user presses the finish recording button. Is passed sound file information (see below)
maxDurationMillisnumber600000 (10 miniutes)maximum length of the recording in milliseconds
completeButtonTextstringfinishedtext dsplayed on the button that executes the onComplete callback
audioModeobjectsee belowa set of key value pairs used to customize recording see Expo documentation
timeStampStyleobject{color: 'blue',fontSize: 40}style of the timestamp displayed while playing and recording
showTimeStampbooleantruedetermines whether or not to display timestamp
showDebugbooleanfalseshows debug related items in a view on the recorder screen

Sound Clip information returned by this component

The onComplete callback receives an object similiar to the following

"size":115824,
"modificationTime":1515107376,
"uri":"file:///data/user/0/host.exp.exponent/cache/ExperienceData/%2540reggie3%252Freact-native-expo-sound-recorder/Audio/recording-20cfc766-faba-47cf-9914-8fc81b149012.m4a",
"isDirectory":false,
"exists":true,
"durationMillis": 34535

Default Audio Mode Object