Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/crazelu/sound-manager
A Flutter plugin for recording and playing audio files on Android and iOS.
https://github.com/crazelu/sound-manager
Last synced: 25 days ago
JSON representation
A Flutter plugin for recording and playing audio files on Android and iOS.
- Host: GitHub
- URL: https://github.com/crazelu/sound-manager
- Owner: Crazelu
- License: other
- Created: 2021-03-13T01:37:29.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-03-19T17:10:54.000Z (over 2 years ago)
- Last Synced: 2024-10-09T09:03:00.706Z (about 1 month ago)
- Language: Java
- Homepage:
- Size: 155 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# sound_manager
A Flutter plugin for recording and playing audio files on Android and iOS
## Install
In the pubspec.yaml of your flutter project, add the following dependency:
```yaml
git:
url: https://github.com/Crazelu/sound-manager.git
```
Import the package in your project:```dart
import 'package:sound_manager/sound_manager.dart';
```
## UsageInitialize plugin and request permissions
```dart
//record is set to true to request permissions for recording audio
//for playing audio, this parameter can be omitted
await SoundManager.init(record: true);
```
Record Audio```dart
await SoundManager.record(
fileName: "test",
directory: "Download",
outputFormat: OutputFormat.amr_wb,
audioEncoder: AudioEncoder.amr_wb,
bitRate: 128000,
);
```Play Audio
```dart
await SoundManager.play(filePath: "/audio-file-path");
```## What's in the box
- Record audio
- Pause and resume recording (Android API level 24+)
- Cancel audio recording
- Save recordings in amr, mp4, aac and 3gp formats
- Encode audio using AAC, AMR_NB, AMR_WB, etc encoders. [Learn more](https://developer.android.com/reference/android/media/MediaRecorder.AudioEncoder)
- Play audio files from device and the internet (https/rstp streams)
- Pause and resume playing audio files
- Seek to position
- Audio looping## TODO
- Add support for ogg audio format
- Include bit rate and sampling rate customizations
- Add support for playing asset files