Stuff like this is often defined with consent. If you tell someone you like the sound of them sleeping and ask if they mind you listening to it, that’s consent. If you’re putting yourself around sleeping people to listen in without their knowledge there’s no consent.