FlameAudio class

This utility class holds static references to some global audio objects.

You can use as a helper to very simply play a sound or a background music. Alternatively you can create your own instances and control them yourself.

Constructors

FlameAudio()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

audioCache AudioCache
Access a shared instance of the AudioCache class.
getter/setter pair
audioCacheFactory AudioCacheFactory
The factory used to create the global AudioCache instance.
getter/setter pair
bgm Bgm
Access a shared instance of the Bgm class.
final
bgmFactory BgmFactory
The factory used to create the global Bgm instance.
getter/setter pair

Static Methods

createPool(String sound, {required int maxPlayers, int minPlayers = 1}) Future<AudioPool>
Creates a new Audio Pool using Flame's global Audio Cache.
loop(String file, {double volume = 1.0}) Future<AudioPlayer>
Plays, and keeps looping the given file.
loopLongAudio(String file, {double volume = 1.0}) Future<AudioPlayer>
Plays, and keep looping the given file This method supports long audio files
play(String file, {double volume = 1.0}) Future<AudioPlayer>
Plays a single run of the given file, with a given volume.
playLongAudio(String file, {double volume = 1.0}) Future<AudioPlayer>
Plays a single run of the given file file This method supports long audio files
updatePrefix(String prefix) → void
Updates the prefix in the global AudioCache and bgm instances.