用户可借助此项目在 OpenHarmony 平台实现 MP3 格式录音功能,支持开始、暂停、恢复及停止录音并导出文件,通过平台原生 API 开发,适配不同 Flutter 版本,集成便捷。【此简介由AI生成】
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 5 个月前 | ||
| 6 年前 | ||
| 6 年前 | ||
| 5 年前 | ||
| 6 年前 | ||
| 5 年前 | ||
| 1 年前 | ||
| 6 年前 | ||
| 6 年前 | ||
| 6 年前 | ||
| 5 年前 | ||
| 6 年前 | ||
| 5 个月前 | ||
| 7 个月前 | ||
| 1 年前 | ||
| 7 个月前 | ||
| 5 个月前 | ||
| 5 年前 | ||
| 6 年前 |
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 <2.0.0
dependencies:
record_mp3: ^2.1.0
Flutter >=2.0.0 nullsafety
dependencies:
record_mp3:
git:
url:git://github.com/fluttercandies/flutter_record_mp3
dependencies:
record_mp3: ^3.0.0
Usage
OpenHarmony
- 中文
- EN
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();