Syncing PWM with Audio

I have a project in mind that will use an embedded micro controller (probably a nano) to keep a pump running at about 60% and then surge it 80-100% based on the time code in an audio / video file from an external media player.

I have never worked with arduino before so my questions are probably a little green.

  1. Is the Arduino nano the right (or at least adequate) controller to use?

  2. Is there an accessory I would need to get to read the time code

  3. I have searched for the code to do this but I have only found an SMTPE reader. Does anyone have code to do this or similar code I can modify?

[QUTOE]2. Is there an accessory I would need to get to read the time code[/QUOTE]You could "hack" an open-source software audio player (such as VLC). Or you could write your own (software) player. Then, you'd have to communicate that information to the Arduino, Either way, that's not an easy project.

If you know when the song/program starts, you can start a separate timer in the Arduino.

If your player happens to be an Arduino audio shield, things get a lot easier because the Arduino "knows" when the file starts playing (and it can know the playing time if you put that information into your software).

  1. I have searched for the code to do this but I have only found an SMTPE reader. Does anyone have code to do this or similar code I can modify?

That's not really the problem... The problem is knowing "where you are currently". It's easy for the player to know the current time (or the time remaining) because the sample rate tells you the number of samples per second (i.e. 44,100 samples per second for CD audio) and the player-software (or firmware) is in-charge of the sample-rate, so it can easily count the samples or count the time.

  1. Is the Arduino nano the right (or at least adequate) controller to use?

If you can get the time into the Arduino, yes, the rest is trivial.