Led follow a mps file (heartbeat)

I am trying to make a LED follow a heartbeat, like this.

Is there a way to array a mp3 file to how long the delay should be?

Making a LED follow a mp3 file.

I am not thinking af the led sould react to sound as input. Like connecting a sound sencor to the LED.

The point is to have a robot with a normal heartbeat. (A sound of a heart beat follow a LED)
When you get to close the robots heart (LED with the heart beat sound) increases.

With an "artificial" heartbeat it might be easier to program the sound and LED together (controlled by the same software) rather than by detecting the heartbeat.

But, you can make a sound activated effect. If you have a "normal" line-level or headphone-level audio signal, you need to [u]bias the input[/u] (2 equal-value resistors and a capacitor). Then you simply set a threshold i.e. If analogRead is greater than 800, turn on the LED. (800 is just a made-up number... You'll have to check your input level and experiment.

You may not need a delay, but you might want to hold-on the LED for something like 100-500mS every time it's triggered.

Is there a way to array a mp3 file to how long the delay should be?

No there is no way to do anything on a Arduino with an MP3 file unless you have external hardware.

You can output a simple WAV file, and without extra memory ( that is an SD card ) you can play back about 3.5 seconds of audio on a Uno.