adafruit wave shield for arduino kit - v1.1

Hello,
I am new to arduino and have never programmed before. I am currently working on a project where I am using adafruit wave shield for arduino kit - v1.1 to play wave files.
basically I have IR LED and sensor, when the something passes between the sensor and the LED, the audio module is supposed to play a sound. and I am also using shift registers to turn on some LEDs. one set of two shift registers put together. and another shift register by itself.
I dont know what is wrong with my code but regardless of the sensor the arduino just playes all the tracks on the sd card.

#include <FatReader.h>
#include <SdReader.h>
#include <avr/pgmspace.h>
#include "WaveUtil.h"
#include "WaveHC.h"


SdReader card;    // This object holds the information for the card
FatVolume vol;    // This holds the information for the partition on the card
FatReader root;   // This holds the information for the filesystem on the card
FatReader f;      // This holds the information for the file we're play

WaveHC wave;    


#define IRsensorPin 11
#define IRledPin 12

int latchPin = 7;
int clockPin = 9;
int dataPin = 8;
int latchPin2 = 1;
int clockPin2 = 6;
int dataPin2 = 0;
 
byte counter = 0;
byte counterCheck = 0;

void IR38Write() {
  for(int i = 0; i <= 384; i++) {
    digitalWrite(IRledPin, HIGH);
    delayMicroseconds(13);
    digitalWrite(IRledPin, LOW);
    delayMicroseconds(13);
  }
}

void setup(){
  
  pinMode(latchPin, OUTPUT);
  pinMode(dataPin, OUTPUT);  
  pinMode(clockPin, OUTPUT);
  pinMode(latchPin2, OUTPUT);
  pinMode(dataPin2, OUTPUT);  
  pinMode(clockPin2, OUTPUT);
  
  pinMode(IRledPin, OUTPUT);
  digitalWrite(IRledPin, LOW);
  
    // set up serial port
  //Serial.begin(9600);
  //putstring_nl("WaveHC with 6 buttons");
  
   
  
  // Set the output pins for the DAC control. This pins are defined in the library
  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
 
  // pin13 LED
  pinMode(13, OUTPUT);
  
   
  if (!card.init()) {         //play with 8 MHz spi (default faster!)  
    putstring_nl("Card init. failed!");  // Something went wrong, lets print out why
    
    while(1);                            // then 'halt' - do nothing!
  }
  
  // enable optimize read - some cards may timeout. Disable if you're having problems
  //card.partialBlockRead(true);
 
// Now we will look for a FAT partition!
  uint8_t part;
  for (part = 0; part < 5; part++) {     // we have up to 5 slots to look in
    if (vol.init(card, part)) 
      break;                             // we found one, lets bail
  }
  if (part == 5) {                       // if we ended up not finding one  :(
    putstring_nl("No valid FAT partition!");

    while(1);                            // then 'halt' - do nothing!
  }
  
  // Lets tell the user about what we found
  putstring("Using partition ");
  Serial.print(part, DEC);
  putstring(", type is FAT");
  Serial.println(vol.fatType(),DEC);     // FAT16 or FAT32?
  
  // Try to open the root directory
  if (!root.openRoot(vol)) {
    putstring_nl("Can't open root dir!"); // Something went wrong,
    while(1);                             // then 'halt' - do nothing!
  }
  
  // Whew! We got past the tough parts.
  putstring_nl("Ready!");
}





void loop(){
  
  IR38Write();
  if (digitalRead(IRsensorPin)==HIGH){

    Serial.println("what what");  
    playSound();
    update2ndShiftRegister();    
    counter ++;
  }
  delay(100);
  
  updateShiftRegister();
 /* if (counterCheck < counter){
         update2ndShiftRegister();
         
         counterCheck = counter;
  }*/
  delay(100);
}

 

 
void update2ndShiftRegister(){
 for(int i=0; i<9; i++){
              digitalWrite(latchPin2, LOW);
              shiftOut(dataPin2, clockPin2, LSBFIRST, bit(i));
              digitalWrite(latchPin2, HIGH);
              delay(100);
 } 
  
}


void updateShiftRegister()
{
   switch (counter) {
      
      case 0:
              digitalWrite(latchPin, LOW);
              shiftOut(dataPin, clockPin, LSBFIRST, 250);
              shiftOut(dataPin, clockPin, LSBFIRST, 250);
              digitalWrite(latchPin, HIGH);
              break;
              
      case 1:
              digitalWrite(latchPin, LOW);
              shiftOut(dataPin, clockPin, LSBFIRST, 48);
              shiftOut(dataPin, clockPin, LSBFIRST, 250);
              digitalWrite(latchPin, HIGH);
              break;
              
      case 2:
              digitalWrite(latchPin, LOW);
              shiftOut(dataPin, clockPin, LSBFIRST, 220);
              shiftOut(dataPin, clockPin, LSBFIRST, 250);
              digitalWrite(latchPin, HIGH);
              break;
              
      case 3:
              digitalWrite(latchPin, LOW);
              shiftOut(dataPin, clockPin, LSBFIRST, 188);
              shiftOut(dataPin, clockPin, LSBFIRST, 250);
              digitalWrite(latchPin, HIGH);
              break;
              
      case 4:
              digitalWrite(latchPin, LOW);
              shiftOut(dataPin, clockPin, LSBFIRST, 54);
              shiftOut(dataPin, clockPin, LSBFIRST, 250);
              digitalWrite(latchPin, HIGH);
              break;
              
      case 5:
              digitalWrite(latchPin, LOW);
              shiftOut(dataPin, clockPin, LSBFIRST, 174);
              shiftOut(dataPin, clockPin, LSBFIRST, 250);
              digitalWrite(latchPin, HIGH);
              break;
              
      case 6:
              digitalWrite(latchPin, LOW);
              shiftOut(dataPin, clockPin, LSBFIRST, 238);
              shiftOut(dataPin, clockPin, LSBFIRST, 250);
              digitalWrite(latchPin, HIGH);
              break;
              
      case 7:
              digitalWrite(latchPin, LOW);
              shiftOut(dataPin, clockPin, LSBFIRST, 176);
              shiftOut(dataPin, clockPin, LSBFIRST, 250);
              digitalWrite(latchPin, HIGH);
              break;
              
      case 8:
              digitalWrite(latchPin, LOW);
              shiftOut(dataPin, clockPin, LSBFIRST, 254);
              shiftOut(dataPin, clockPin, LSBFIRST, 250);
              digitalWrite(latchPin, HIGH);
              break;
              
      case 9:
              digitalWrite(latchPin, LOW);
              shiftOut(dataPin, clockPin, LSBFIRST, 182);
              shiftOut(dataPin, clockPin, LSBFIRST, 250);
              digitalWrite(latchPin, HIGH);
              break;
              
      case 10:
              digitalWrite(latchPin, LOW);
              shiftOut(dataPin, clockPin, LSBFIRST, 250);
              shiftOut(dataPin, clockPin, LSBFIRST, 192);
              digitalWrite(latchPin, HIGH);
              break;
              
      
   
              
      default:
      
              break;
              
   }
}

void playSound() {
  putstring(".");            // uncomment this to see if the loop isnt running
  
  int song = random(10);
  Serial.println(song);  
  switch (counter) {
    case 0:
      playcomplete("0.WAV");
      break;
    case 1:
      playcomplete("1.WAV");
      break;
    case 2:
      playcomplete("2.WAV");
      break;
    case 3:
      playcomplete("3.WAV");
      break;
    case 4:
      playcomplete("4.WAV");
      break;
    case 5:
      playcomplete("5.WAV");
      break;
    case 6:
      playcomplete("6.WAV");
      break;
    case 7:
      playcomplete("7.WAV");
      break;
    case 8:
      playcomplete("8.WAV");
      break;
    case 9:
      playcomplete("9.WAV");
      break;
      
    default:
      break;
      
  }
}

// Plays a full file from beginning to end with no pause.
void playcomplete(char *name) {
  // call our helper to find and play this name
  playfile(name);
  while (wave.isplaying) {
  // do nothing while its playing
  }
  // now its done playing
}

void playfile(char *name) {
  // see if the wave object is currently doing something
  if (wave.isplaying) {// already playing something, so stop it!
    wave.stop(); // stop it
  }
  // look in the root directory and open the file
  if (!f.open(root, name)) {
    putstring("Couldn't open file "); Serial.print(name); return;
  }
  // OK read the file and turn it into a wave object
  if (!wave.create(f)) {
    putstring_nl("Not a valid WAV"); return;
  }
  
  // ok time to play! start playback
  wave.play();
}

I am using the code for the wave shield from one of the examples that I found.
I can get the sensor to work without the waveshield, just trigger LEDS. that works, but as soon as I try to use the waveshield it does nothing.

You are using pins 11 & 12 for your IR sensor. These pins are used by the SD interface in the wave shield. Move this to some other pins.