libstormgames.sfx makes sound effects with numpy and scipy, so a game can
use them without shipping sound files, and every game that asks for the
same sound with the same seed gets exactly the same samples. The sounds
come from Grave Racer and match it sample for sample.
The modules are synth (waves, filters, envelopes, loops), impacts, ui,
rewards, materials, creatures, babble, vehicles, ambience and alerts.
sfx.make_sound turns a sound into a pygame Sound for the mixer as it is
set up, turning down only a sound that would go past full scale.
sfx.add_sounds adds generated sounds by name, keeping any sound file of
the same name.
The menus' menu-move and menu-select sounds are generated when a game
has no file for them. sfx and scipy are only imported then, so a game
that ships both files, or never uses sfx, is not slowed down or made to
need scipy.
The tests check every sound against a stored fingerprint, so none can
change by accident; tools/update-sfx-fingerprints.py remakes them after
a deliberate change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>