Player class final

Controls loading, unloading and generating of Sounds.

Should be initialized before doing anything. Should be started to hear any sound.

Available extensions

Constructors

Player()

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

genNoise(NoiseType type) → NoiseSound
Generates a noise with the provided type.
genPulse({double freq = 440.0, double dutyCycle = 0.5}) → PulseSound
Generates a pulsewave sound with provided freq and dutyCycle.
genWaveform(WaveformType type, {double freq = 440.0}) → WaveformSound
Generates a waveform sound with provided type and freq.
init([int periodMs = 32]) → Future<void>
Initializes the engine.
loadSound(TypedData audioData) → Future<LoadedSound>
Copies data to the internal memory location and creates a LoadedSound from it.
loadSoundAsset(String assetPath) → Future<LoadedSound>

Available on Player, provided by the PlayerLoadSoundAsset extension

Loads a sound asset and creates a LoadedSound from it.
loadSoundFile(String filePath) → Future<LoadedSound>
Loads a file and creates a LoadedSound from it.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
start() → Future<void>
Starts the engine.
toString() → String
A string representation of this object.
inherited

Operators

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