Skip to content
This repository was archived by the owner on Aug 21, 2020. It is now read-only.

Commit 42eee8d

Browse files
committed
update README for 2.0.0
1 parent 7310f7f commit 42eee8d

File tree

1 file changed

+28
-27
lines changed

1 file changed

+28
-27
lines changed

README.md

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,37 @@
1-
## react-native-audio for iOS and android
2-
3-
An audio recording and playback library for React Native iOS apps.
4-
5-
On iOS, it supports most iOS AVAudioRecorder class configuration options.
1+
Record and play back audio in your iOS or Android React Native apps.
62

73
### Installation
84

9-
Install the package via npm, and link the binary to your iOS and Android projects:
5+
Install the npm package and link it to your project:
106

117
```
128
npm install react-native-audio
139
react-native link react-native-audio
1410
```
1511

16-
#### Extra Android installation step
12+
On *Android* you need to add a permission to `AndroidManifest.xml`:
1713

18-
Update AndroidManifest.xml by adding the `RECORD_AUDIO` permission:
1914
```
2015
<uses-permission android:name="android.permission.RECORD_AUDIO" />
2116
```
2217

23-
### Running the Sample App On iOS
18+
### Running the Sample App
2419

2520
In the `AudioExample` directory:
2621

2722
```
2823
npm install
2924
react-native run-ios
30-
```
31-
32-
### Running the Sample App On Android
33-
34-
In the `AudioExample` directory:
35-
36-
```
37-
npm install
3825
react-native run-android
3926
```
4027

4128
### Usage
4229

43-
This library supports recording, basic playback and progress reporting. Progress reporting is iOS only for now.
30+
This library supports recording, basic playback and progress reporting.
4431

45-
To record in AAC format, at 22050 KHz in low quality mono with metering enabled:
32+
NOTE: Progress reporting is *iOS only* for now.
33+
34+
To record in AAC format, at 22050 KHz in low quality mono:
4635

4736
```
4837
import {AudioRecorder, AudioUtils} from 'react-native-audio';
@@ -52,21 +41,33 @@ AudioRecorder.prepareRecordingAtPath(audioPath, {
5241
SampleRate: 22050,
5342
Channels: 1,
5443
AudioQuality: "Low",
55-
AudioEncoding: "aac",
56-
MeteringEnabled: true
44+
AudioEncoding: "aac"
5745
});
5846
```
5947

60-
See [the example](https://github.com/jsierles/react-native-audio/blob/master/AudioExample/index.ios.js) for more options, including playback and callbacks. For more audio play options, check out [React Native Sound](https://github.com/zmxv/react-native-sound)
48+
#### Cross-platform options
49+
50+
SampleRate: int
51+
Channels: int
52+
AudioQuality: string
53+
AudioEncoding: string
54+
55+
Encodings supported on iOS: lpcm, ima4, aac, MAC3, MAC6, ulaw, alaw, mp1, mp2, alac
56+
Encodings supported on Android: aac, aac_eld, amr_nb, amr_wb, he_aac, vorbis
57+
58+
#### iOS-only fields
59+
60+
The `MeteringEnabled` boolean to enable audio metering.
6161

62-
### Supported audio formats
62+
#### Android-only fields
6363

64-
A subset of formats listed here are supported: https://developer.apple.com/reference/coreaudio/1572096-audio_data_format_identifiers
64+
AudioEncodingBitRate: int
65+
OutputFormat: string, (mpeg_4, aac_adts, amr_nb, amr_wb, three_gpp, webm)
6566

66-
Currently supported format arguments: lpcm, ima4, aac, MAC3, MAC6, ulaw, alaw, mp1, mp2, alac.
67+
See [the example](https://github.com/jsierles/react-native-audio/blob/master/AudioExample/index.ios.js) for more options, including playback and callbacks. For more audio play features, check out [React Native Sound](https://github.com/zmxv/react-native-sound)
6768

68-
MP3 recording is not supported on iOS.
69+
MP3 recording is *not supported* since the underlying platforms do not support it.
6970

70-
Thanks to Brent Vatne, Johannes Lumpe, Kureev Alexey and Matthew Hartman for their assistance.
71+
Thanks to Brent Vatne, Johannes Lumpe, Kureev Alexey, Matthew Hartman and Rakan Nimer for their assistance.
7172

7273
Progress tracking code borrowed from https://github.com/brentvatne/react-native-video.

0 commit comments

Comments
 (0)