Delay with airplay when MacBook is closed
So I have a MacBook Pro m5 which is connected to my monitor via HDMI. I also have a Sonos sound system which usually I can connect my phone to with airplay with no delay at all. however ever since i got a keyboard and mouse and use my computer with my MacBook closed, there has been a pretty big delay with my sound system. not only that, the MacBook takes really long to charge and I can't use my phone as a camera and microphone.
Please help me find a solution
MacBook Pro 14″, macOS 26.2