Problem using distance detector to activate MP3 reader

Hi,

I like to activate song when distance detector detect movement.
I make all the connectors but I think there is a problem with my code (I attached my code).
Pleas advise,
Adoram.

#include <SimpleSDAudio.h>
#define trigPin 8
#define echoPin 7
#define speaker 9
void setup() {

SdPlay.setSDCSPin(4); // sd card cs pin
Serial.begin (9600);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(speaker, OUTPUT);
if (!SdPlay.init(SSDA_MODE_FULLRATE | SSDA_MODE_MONO | SSDA_MODE_AUTOWORKER))

{ while(1); }

if(!SdPlay.setFile(“aaa2.wav”)) // music name file

{ while(1);
SdPlay.play();
}

}

void loop(void)

{
long duration, distance;
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = (duration/2) / 29.1;
SdPlay.play();
if (distance < 40) {
digitalWrite(speaker ,HIGH);
delay(5000);
}
else {
digitalWrite(speaker ,LOW);
}

}

    while (1);
    SdPlay.play();

How will the program ever leave the while loop with no code in it ?