match_magic/lib/utilities/audio_manager.dart

24 lines
473 B
Dart
Raw Permalink Normal View History

2024-09-09 12:09:43 +00:00
import 'package:flame_audio/flame_audio.dart';
class AudioManager {
static Future<void> load() async {
await FlameAudio.audioCache.loadAll([
'select.ogg',
'four_elements.ogg',
'explosion.ogg',
]);
}
static void playSelectSound() {
FlameAudio.play('select.ogg');
}
static void playFourElementsSound() {
FlameAudio.play('four_elements.ogg');
}
static void playExplosionSound() {
FlameAudio.play('explosion.ogg');
}
}