Here’s a nice Instructable tutorial from jenfoxbot. She uses an infra-red sensor that detects when the beam is broken and then plays music. The sensor is set-up across a doorway so that when someone comes through the door, omxplayer is triggered and sound comes out. It’s interesting because the normal way of doing this sort of thing is to use a PIR sensor. Read the Instructable here.