If you've already turned off the battery optimization option for Spotify, try reinstailling the app to see if it helps.
In case the reinstallation doesn't do the trick, let us know if this is happening while you listen with a specific audio output (e.g. Bluetooth headphones, phone speakers, etc...).
All the best.
“Music acts like a magic key, to which the most tightly closed heart opens.”
― Maria Augusta von Trapp