Mp3-Player Arduino Uno with ASA1

Hello,

I just don't understand whats wrong. I have 3 buttons and every should play another sound, if you press it. Later, it should have 16 buttons and every should play another sound. The songs should play until end. But the program doesn't work.. There is no error message or something else, but I easily can't hear anything. This is our Arduino Uno board together with the Audio Shield ASA1:

And this is the program which doesn't work:

#include <SD.h>
#include <SPI.h>
#include <AudioShield.h>

const int buttonPin = 2; // the number of the pushbutton pin
const int buttonPin2 = 3; // the number of the second pushbutton pin
const int buttonPin3 = 4; // the number of the third pushbutton pin

// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
int buttonState2 = 0; // variable for reading the second pushbutton status
int buttonState3 = 0; // variable for reading the third pushbutton status

void setup() {

if( SD.begin( SD_CS ) == false )
{
return;
}

pinMode(buttonPin, INPUT);
pinMode(buttonPin2, INPUT);
pinMode(buttonPin3, INPUT);

VS1011.begin();
}

void loop(){

buttonState = digitalRead(buttonPin);
buttonState2 = digitalRead(buttonPin2);
buttonState3 = digitalRead(buttonPin3);

if (buttonState == HIGH) {
unsigned char buffer[32];
File SoundFile = SD.open( "002.mp3", FILE_READ );
VS1011.UnsetMute();
while( SoundFile.available() )
{
SoundFile.read( buffer, sizeof(buffer) );
VS1011.Send32( buffer );
}
VS1011.Send2048Zeros();
VS1011.SetMute();
SoundFile.close();
}
else { delay(1000); }

if (buttonState2 == HIGH) {
unsigned char buffer[32];
File SoundFile = SD.open( "003.mp3", FILE_READ );
VS1011.UnsetMute();
while( SoundFile.available() )
{
SoundFile.read( buffer, sizeof(buffer) );
VS1011.Send32( buffer );
}
VS1011.Send2048Zeros();
VS1011.SetMute();
SoundFile.close();
}
else { delay(1000); }

if (buttonState3 == HIGH) {
unsigned char buffer[32];
File SoundFile = SD.open( "004.mp3", FILE_READ );
VS1011.UnsetMute();
while( SoundFile.available() )
{
SoundFile.read( buffer, sizeof(buffer) );
VS1011.Send32( buffer );
}
VS1011.Send2048Zeros();
VS1011.SetMute();
SoundFile.close();
}
else { delay(1000); }
}

You won't do any actions inside main loop while sound is playing, loop is blocked by this line - while( Sound File.available() ). Try to use timer interrupts for buttons events.

void setup() {
cli(); //stop interrupts
TCCR2A = 0; // normal operation
TCCR2B = (1<<CS20); // prescaler 8
TCCR2B = (1<<CS21); // prescaler 8
TCCR2B = (1<<CS22); // prescaler 8
TIMSK2 = (1<<TOIE2); // enable overflow interrupt
sei(); //allow interrupts
}

ISR(TIMER2_OVF_vect) {
// code for buttons
}