OMG, stop the madness!!! How could you have possibly written a 3000 line program without having the slightest clue regarding the most basic constructs of the language? Do yourself a favor, set this project aside for a while and learn the fundamentals of C++ programming.
Before you do, here's one more fish for you:
void playWav (char* name);
void setup() {
}
void loop() {
//...
//...
playWav ("alarm");
//...
//...
}
void playWav (char* name) {
char buffer [40];
//..
//..
sprintf (buffer, "wav/%s.wav", name);
file = new AudioFileSourceSD(buffer);
//...
//...
}
BTW, if the memory leak I warned you about shows up, it will make this problem seem like child's play. You'll get random crashes at random times in random locations and won't have a clue what's causing it. So, I'd make sure those dynamically-allocated objects eventually get deleted.
Now, go learn to fish.