Arduino uno+ ultrasonic sensor+speaker+led

Hi all! The system I'm trying to setup is when the distance the sensor senses become less than 4 cm, the wav file I've stored in my sd card would play from the speaker, and the green led light would turn off. But when it's between 4 and 200 cm, then the led light would stay on.

When I have two separate coding (ultrasonic sensor+led, and speaker alone) they work just fine. But when I try to combine these two (obviously I did something wrong here), the sensor is the only thing still working. The green led light wouldn't turn on no matter what the distance is, and there's no sound coming out the speaker.

Here's the code:

#include "SD.h"
#define SD_ChipSelectPin 4
#include "TMRpcm.h"
#include "SPI.h"
TMRpcm tmrpcm;

#define trigPin 13
#define echoPin 12
#define led2 10

void setup() {
tmrpcm.speakerPin = 9;
Serial.begin (9600);

pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(led2, OUTPUT);
}

void loop() {
long duration, distance;
digitalWrite(trigPin, LOW); // Added this line
delayMicroseconds(2); // Added this line
digitalWrite(trigPin, HIGH);
// delayMicroseconds(1000); - Removed this line
delayMicroseconds(10); // Added this line
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = (duration/2) / 29.1;

if (distance < 4) { // This is where the LED On/Off happens

tmrpcm.setVolume(8);
tmrpcm.play("hey.wav");

digitalWrite(led2,LOW);
}
else {
digitalWrite(led2,HIGH);
}
if (distance >= 200 || distance <= 0){
Serial.println("Out of range");
}
else {
Serial.print(distance);
Serial.println(" cm");
}
delay(500);
}

Would anyone let me know the problem is? Sorry for my bad English, thank you in advance!

Please use code tags (</> button on the toolbar) when you post code or warning/error messages. The reason is that the forum software can interpret parts of your code as markup (the smiley face in the code above for example), leading to confusion, wasted time, and a reduced chance for you to get help with your problem. This will also make it easier to read your code and to copy it to the IDE or editor. Using code tags and other important information is explained in the How to use this forum post. Please read it.

Please always do a Tools > Auto Format on your code before posting it. This will make it easier for you to spot bugs and make it easier for us to read.

Are you seeing the expected results in the Serial Monitor?

Perhaps you need to set the volume to :o , instead.

Why is there a number in the name led2? You don't appear to have more than one LED, and it isn't on pin 2.