Prevent reiteration of loop instruction in Arduino/Execute instruction via off switch
An Arduino doesn't understand the concept of "powering off".  It is either on (running) or off (not able to do anything).

Your first task must be to design a system whereby the Arduino can control its own power so the Arduino can then go "I have been asked by this external stimulus to switch off. Therefore I will play this sound and then perform whatever actions are required to remove power from myself."

Only when you have worked out how you can get the Arduino to control its own power and still have the ability to manually turn the power on can you begin to think about adding things that happen "when it powers off".