Your requirements are a bit hard to distill from that message.
It seems you want to have a message played when someone enters a room through a door (not necessarily when the door opens), and another message when that door closes.
Playing messages: record them as WAV file to SD card, place than in a DF Player module, and the Arduino can control it. Connect speakers/amplifiers as needed.
Recording a door closing: magnetic switch.
Recording someone enters a room: two break beam sensors (so you can tell direction: entering or exiting) is probably the most reliable method for this.