there is a magnetic switch on a box to sense the voltage.
On what box? To sense what voltage? A magnetic switch doesn't sense voltage.
When the box is open, the magnet move apart, and sound will be played.
That has nothing to do with sensing voltage. The sensor senses the change in the magnetic field as the magnet is moved.
However, I just want to play the sound one time
One time, each time the box is opened? Or one time, period?
Alarm.delay(1000); // wait one second between clock display
That's going to make the box unresponsive.
I therefore havev no choice but put a delay(10000) at the end.
Sure you do. You want to play the music when the sensor state BECOMES LOW, not IS LOW. Look at the state change detection example to see how to differentiate between BECOMES and IS.