Quick answer: Pygame music loop occasionally skipping a fraction of a second when the game has a heavy frame? Audio buffer underrun; raise buffer size or pre-mix.
Boss fight with heavy VFX: music has audible 100ms gap each time the FPS spikes.
Raise mixer buffer
pygame.mixer.init(44100, -16, 2, 4096)Larger buffer; survives longer frames.
Or pre-render music chunks
Decode music to WAV at load time; play uncompressed. Lower CPU; less risk.
Profile frame spike causes
FPS spikes affect audio; fix the spikes; fix the audio.
“Audio underrun is a frame budget signal. The audio is the canary.”
If your audio crackles or skips, the frame budget is suspect. Audio issues lead to render issues; fix together.