AudioPool class

An AudioPool is a provider of AudioPlayers that are pre-loaded with local assets to minimize delays.

All AudioPlayers loaded are for the same sound. If you want multiple sounds use multiple AudioPool. Use this class if you'd like have extremely quick firing, repetitive and simultaneous sounds, like shooting a laser in a fast-paced spaceship game.

Properties

audioCache → AudioCache
Instance of AudioCache to be used by all players.
final
hashCode int
The hash code for this object.
no setterinherited
maxPlayers int
Max and min numbers of players.
final
minPlayers int
Max and min numbers of players.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sound String
The path of the sound of this pool.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
start({double volume = 1.0}) Future<Stoppable>
Starts playing the audio, returns a function that can stop the audio.
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

create(String sound, {AudioCache? audioCache, int minPlayers = 1, required int maxPlayers}) Future<AudioPool>
Creates an AudioPool instance with the given parameters.