Loud audio in builds (sometimes) in last frame when quitting

I’ve got this bug where it sounds like our audio mixers reset back to 0db in a single frame when quitting (music goes to max volume), sometimes (1 in 20) and only in builds.

However, I tested and checked to see if we had any audiolisteners or audiosources in scene at the moment of quitting (after all the scenes have unloaded and it’s just the DontDestroyOnLoad scene), and there are 0, and the mixers in the Audio Controller no longer exist as well. I suspect this is something internal, or something to do with threads, because the Time scale is set to 0 while quitting, and the audio snippet that plays is a continuation of the audio that previously existed in scene (music and environment). So doing a general post here in case someone has insight into why this might be occurring.

(One suspicion that I have is that it might be caused by audio mixer snapshots that are set in game to change to over time, before closing, and when those mixers no longer exist and just before the game closes, time scale is no longer 0 or something internal and those snapshots somehow execute?)

We did fix something kind of similar in 2021.3.35f1 Unity Issue Tracker - Audio plays for a split second when Mixer's volume is set to 0 beforehand

but that was focused on setting volume in Start(). If you havent updated to that version yet give it a try. Otherwise we would appreciate a repro project and bug report :slight_smile:

1 Like

This is something different. The pop is caused by the audio wave being set to 0 or max suddenly in one frame. The audio playing here is music, just very loudly.
Something here is changing the audio mixer suddenly, but after the last frame of the game, and when there are no mixers.

1 Like

Also, project is NDA, so can’t pass current project. I could attempt to replicate in a new project.