Audio
Making noise.
The second of the two modules in src/ that touch Java, and the only one that touches
the sound card. Everything above it deals in SoundCmd values.
The waveforms are synthesized here at startup rather than loaded from files: an arcade bleep is a swept square wave and a burst of noise, both of which are a few lines of arithmetic, and this keeps the repository free of audio assets.
Nothing here is allowed to take the game down. A machine with no sound card -- a CI
runner, a headless server, a laptop with the output muted at the driver level -- raises
an IllegalArgumentException from deep inside AudioSystem rather than the declared
LineUnavailableException, so every entry point catches Exception and degrades to
silence.
Type Aliases
A pool of pre-opened clips, tagged with the sound each one plays.
Clip.start() returns immediately, which is what the animation thread needs, but a
single clip cannot overlap with itself -- restarting it cuts the sound in flight. So
each sound gets several voices and a trigger takes the first idle one.
Definitions
Releases every line. Safe to call when audio never opened.
Synthesizes every sound and opens its voices.
Returns an empty list if audio is unavailable, which every other function here treats as "play nothing".