🎧 A simple and flexible audio manager for Flutter apps, designed to handle background music (BGM), sound effects (SE), and other audio playback with ease.
- ✅ Supports asset, file, and network audio sources
- 🔁 Loop playback with custom start positions
- 🔊 Volume, speed, and (planned) pitch control
- 📦 Simple API for BGM/SE switching via key or channel
- 🎚️ Global master volume/speed settings
- 🚀 Designed with clean architecture and extensibility in mind
Add audio_box to your pubspec.yaml:
dependencies:
audio_box: ^0.0.8Then import it:
import 'package:audio_box/audio_box.dart';await audioManager.registerAll({
'bgm_menu': AssetAudioSource('assets/bgm/menu.mp3'),
'se_click': AssetAudioSource('assets/se/click.wav'),
});await audioManager.play(key: 'se_click');await audioManager.play(
key: 'bgm_menu',
channel: 'bgm',
loop: true,
fadeDuration: Duration(seconds: 2),
);await audioManager.setMasterVolume(0.8);Check out the /example folder for a full working example.
This package is released under the MIT License.
Created by take-p.