USound class abstract final

Fire-and-forget sound effects (clicks, dings) that mix with the user's music instead of pausing it. USound.play("assets/sounds/tap.mp3")

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

enabled ↔ bool
Turns every sound effect on/off (e.g. from a settings switch).
getter/setter pair
masterVolume ↔ double
Volume multiplier for every effect, 0-1.
getter/setter pair
poolSize ↔ int
How many effects can play at the same time.
getter/setter pair

Static Methods

dispose() → Future<void>
play(Object input, {double volume = 1, bool interrupt = false}) → Future<void>
Plays an effect; interrupt stops the previous one on that player. USound.play("assets/sounds/success.mp3", volume: 0.6)
preload(List<Object> sources) → Future<void>
Warms up assets so the first play has no delay. USound.preload(["assets/sounds/tap.mp3"])
resolve(Object input) → UMediaSource
Turns a URL/path/asset string into a cached source.
stopAll() → Future<void>
Stops every effect.