soundtrack library

A soundtrack for flutter3d games: sounds keyed by events, footsteps paid for in metres, and sounds with a lifetime.

A CueSheet keeps what each event sounds like; SoundtrackPlugin hears it from the engine's bus on its frame channel and plays it. Sounding and SustainedVoices are for sounds that outlive a step — a door grinding open. The fires and water flutter3d_effects reports are played by ElementSounds, in flutter3d_game_physics' elements.dart.

The game's own cue lists — its SoundDefs and which event plays which — stay with the game, as data. The sound types are flutter3d_audio_core's, and a game that writes a sheet's SoundDefs imports them from there.

Classes

CueContext<T extends BusEvent>
What a Cue is handed: the event, and the sounds it adds to.
CueSheet
Sounds keyed by event type: a game's own sheet of what each event sounds like.
Footsteps
Footsteps, paid for in metres walked on the ground.
Sounding
Everything one step made a noise about: sounds heard once, and the loops begun, moved and stopped.
SoundtrackPlugin
A CueSheet heard from the engine's bus, on the frame channel, and played.
Sustained
A sound with a lifetime: it starts, it follows the thing making it, and it stops.
SustainedVoices
Plays a Sounding: the one-shots fired and forgotten, and one voice per Sustained.key, begun, moved and stopped as the soundtrack says.
Voice
What is happening to a sound that has a lifetime.

Typedefs

Cue<T extends BusEvent> = void Function(CueContext<T> cue)
What one cue of a CueSheet makes of an event of type T: the sounds it adds to CueContext.out.