Playing voice when ultrasonic sensor detect any hurdle

hey there, I am new at arduino and facing a problem it will be really appreciated if someone can find the error. I am trying this code to play different audio files from SD Card on the different readings of the ultrasonic sensor (HC-04) trying to build a device which can guide blind person of the hurdles ahead of him by telling the distance from hurdle

project.ino (927 Bytes)

It would be really appreciated if you would post your code here, in code tags.

What are you using to play those files?

#include "SD.h"
#define SD_ChipSelectPin 10
#include "TMRpcm.h"
#include "SPI.h"

TMRpcm tmrpcm;
int trigPin = 4;
int echoPin = 5;

void setup() {
              tmrpcm.speakerPin=9;
              Serial.begin(9600); 
              pinMode(trigPin, OUTPUT);
              pinMode(echoPin, INPUT);
              pinMode(9,OUTPUT);

}
void loop() {
            long duration, distance;
            digitalWrite(trigPin,HIGH);
            delayMicroseconds(1000);
            digitalWrite(trigPin, LOW);
            duration=pulseIn(echoPin, HIGH);
            distance =(duration/2)/29.1;
           
           
           if((distance<=300)) {
                                tmrpcm.setVolume(5);
                                tmrpcm.play("test.wav");
           }

           else if(distance>10){
                                tmrpcm.setVolume(5);
                                tmrpcm.play("test.wav");
            }
}

i store audio files in SD card and playing through SD Card Adapter by using wired headphones.