forked from fluttercandies/flutter_record_mp3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.md
53 lines (36 loc) · 848 Bytes
/
README.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Record Mp3
[![pub package](https://img.shields.io/pub/v/record_mp3.svg)](https://pub.dartlang.org/packages/record_mp3)
##### Record an MP3 using the platform native API
## Depend on it
Add this to your package's pubspec.yaml file:
```
Flutter <= 1.19.x
dependencies:
record_mp3: ^1.0.1
```
```
Flutter >=1.12.x
dependencies:
record_mp3: ^2.1.0
```
## Usage
### iOS
Make sure you add the following key to Info.plist for iOS
```
<key>NSMicrophoneUsageDescription</key>
<string>xxxxxx</string>
```
### Example
```
import 'package:record_mp3/record_mp3.dart';
//start record
RecordMp3.instance.start(recordFilePath, (type) {
// record fail callback
});
//pause record
RecordMp3.instance.pause();
//resume record
RecordMp3.instance.resume();
//complete record and export a record file
RecordMp3.instance.stop();
```