flame_audio
2.12.2, released 4 months ago by flame-engine.org
Audio support wrapper for the Flame game engine
What it does
Provides audio capabilities for Flame games using audioplayers underneath. Allows playing general sound effects, looping background music, caching tracks, and managing audio pools.
AI-written summary of version 2.12.2, based on the package's README and metadata. Report an inaccuracy
Use it when
- You are building a game with the Flame engine and need sound effects or background music
- You want a thin audio wrapper optimized for Flame game integration
Skip it when
- You are not using the Flame game engine
- You need a complex standalone music player UI outside of a game context
Strengths
- Seamless integration with Flame game code
- Supports caching tracks and high-frequency audio pools for rapid sound effects
- Built-in background music (bgm) management
Weaknesses
- Thin wrapper; advanced audio manipulation depends entirely on audioplayers
- Requires specific asset directory configuration in pubspec.yaml
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 3
Add audio files to assets/audio and configure assets in pubspec.yaml.
import 'package:flame_audio/flame_audio.dart';
FlameAudio.play('explosion.mp3');
FlameAudio.loop('music.mp3');Alternatives
Packages that do the same job and could replace flame_audio.
- flutter_soloud
A low-level audio plugin for Flutter, mainly meant for games and immersive apps. Based on the SoLoud (C++) and miniaudio audio engine.
95Compare - ffmpeg_kit_flutter_new_audio
Run FFmpeg and FFprobe commands from Dart with prebuilt audio codecs for multiple platforms.
79Compare - audioplayers_platform_interface
Platform interface for the audioplayers Flutter plugin.
77Compare - kplayer
A cross-platform audio player wrapper supporting assets, network, files, and bytes.
47Compare
Works with
Packages commonly used together with flame_audio: ones it builds on, ones built on it, and its own family.
- synchronizedflame_audio depends on itLock mechanism to prevent concurrent access to asynchronous code.
- audioplayersflame_audio depends on itA Flutter plugin to play multiple audio files simultaneously
- flameflame_audio depends on itA minimalist Flutter game engine, provides a nice set of somewhat independent modules you can choose from.
- flame_testSame familyClasses and helpers for testing applications built with the Flame Engine.
- flame_svgSame familyAdds SVG rendering support for the Flame game engine
- flame_blocSame familyIntegration for the Bloc state management library to Flame games.
- flame_lintSame familyA strict and satisfying lint package for Flame, Flutter, or Dart projects.
- flame_forge2dSame familyForge2D physics engine support and wrappers for the Flame game engine.