#!/usr/bin/env python3 """Grade a recorded WAV against expected loudness phases. Shared by scripts/verify-amiga-audio.sh and scripts/verify-dos-audio.sh. Both ports emit sound through hardware no emulator here will let us tap register by register (Paula via fs-uae, a Sound Blaster via DOSBox), so those gates record what actually came out and grade it. The IIgs and ST gates read their chips directly and do not need this. The scripts drive the AUDIO example through four phases whose expected loudness differs by a wide margin, which is what makes recorded audio gradeable at all rather than a judgement call: music the baked tracker song, loud paused P pressed: near silence sfx SPACE during the pause, so ANY sound is the digital SFX resumed P again: loud once more Firing the SFX into a paused song is the whole trick. Mixed under the music an 8-bit one-shot barely moves the total, but against silence it is unambiguous -- and it still proves the two layers coexist, because the music comes back afterwards on the same hardware. Usage: gradeAudioPhases.py