Accelerometer to advance songs

Hi All,

I'm very new to arduino and coding in general and need some help with a project.

I am building a box that when moved in a certain direction (x or y axis) it skips to the next sound file. I have about one hundred .wav files that I edited in audacity. Each file is very short and is a simple audio of a person saying a number. The goal is to make a "counting box" that counts when moved.

I have a wave shield that I have attached a speaker to.

I am thinking that I need to write code that counts when the accelerometer passes a threshold value and for each count associates an audio file to play.

I am just not sure how to begin and how to write this. Any help, direction to helpful examples, would be much appreciated.

I am rougly thinking:

int counter = 0;

void setup { library } 

void loop {    } 

void eventTriggered(  ){
//cycle through song files”mp3)

void readSensors( );
void processData( );

Thank You!

Sorry but you only need about 20 sound clips to say all the numbers if you split things up correctly.

What you posted even though it is pseudo code does not hang together.

The trick with any project is to break it down into small bits. First get it working with a push button to trigger the count, only when that is working go on and add things.