macOS sends a "pause" signal to all players when it sleeps, and any application which can handle that won't be playing any audio when the system wakes up. So if your audio continues the moment you open the lid, please file a bug report for that application.