What can cause a MacBook Pro mid 2015 sound output to fade rapidly to silence?
The amplifier to make sound is the likely cause of failure. Since that’s on the logic board, a free warranty swap or a flat rate repair for $300 or so are the likely costs to fix this properly.
Have you tested installing a new OS on an external drive or wiping and reinstalling in case it’s software? That’s worth doing so you have a backup or confidence you need a repair as well.