activate sounds while walking

I’m trying to achieve the effect of when a player is walking. It seems so simple to loop a sound clip but what if the timing becomes off or your character jumps ect. Not sure the best way of achieving this effect.

In my opinion the best way of achieving this is by adding an event to your characters walk animation. This is done by going into your animation window (ctrl+6 or cmd+6) and right clicking on the top timeline. There you can then call a function each time the animation plays. Make sure you add two events - one when the left foot is on the ground and one when the right foot is on the ground.
The function you call must be in a script on the character and could go like this:

function FootStepAudio () {

  audio.Play();

}