Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lamnhan066/audio_helper
https://github.com/lamnhan066/audio_helper
Last synced: 7 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/lamnhan066/audio_helper
- Owner: lamnhan066
- License: gpl-3.0
- Created: 2022-07-31T15:43:59.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-08T16:17:48.000Z (about 1 year ago)
- Last Synced: 2023-10-09T10:15:03.419Z (about 1 year ago)
- Language: Dart
- Size: 38.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Audio Helper
Help you easier to add sounds and background music to your games or apps.
## Usage
Default path of the asset files:
``` yaml
flutter:
assets:
# Backgound music path
- assets/audio/music/name1.mp3
- assets/audio/music/name2.mp3
# Sound path
- assets/audio/sound/sound.mp3
```Initialize the plugin:
``` dart
await AudioHelper.initial(
backgroundMusicNames: ['name1.mp3','name2.mp3'],
);```
Play & stop background music:
``` dart
/// Play
AudioHelper.playMusic();/// Stop
AudioHelper.stopMusic();
```Play sound:
``` dart
AudioHelper.playSound('sound.mp3');
```**Notice:** I've only tested this plugin on my real project, so it doesn't have any examples or tests yet.