Very specific question, I know, but this is something I've thought about a lot as someone who frequently wears headphones in public and has to contact people in private with them on.
Often, when a friend/SO is wearing headphones I find it challenging to politely get their attention. I really dread when I don't notice and startle them, or when they aren't expecting me and I'm not sure how to proceed. I've tried tapping surfaces near them, approaching slowly, gentle contact, but nearly all of them seems to startle the listener unless they are prepared for interruption (and, to be fair, the same happens to me as well!).
I'm curious if there is an accepted way to get someone's attention when they're immersed in listening through their headphones.
Assume there is a polite and needed circumstance to contact the individual, and that they don't necessarily "not want to be bothered"; they just simply aren't expecting to be contacted at that time. It's not good to break someone's boundaries when they don't want to be bothered, but assume a situation like one I've encountered before: friend says to come to their room whenever, but when approached, is listening to music.