sound effect problem for rapid fire weapon.

Update - Thanks to everyone who replied. The problem was with the audio clip itself, adding a fade in and out removed the stutter.

I'm able to hook up a audio file/sound effect to my gun firing but there's this weird audio stutter when the weapon goes full auto. The audio seems to play fine but its like there's a weird side effect to playing a audio file in very quick succession, or playing a new audio file before the first is finished.

function LateUpdate()
{
    if(can_shoot)
    {
        //fire pew pew
        if(shot_sound)
        {
            audio.Stop();
            audio.clip = shot_sound;
            audio.Play();
        }
    }
}

I have no experience with audio and the sounds I'm using are the best i could build in Audacity using tones.

Any help or information would be appreciated.

Its because you have placed your audio code within an Update (which is called every frame) - so essentially, your audio is being played every frame.

You want to do something like this:

var audioPlay : boolean = true;

function LateUpdate(){

   if(can_shoot && audioPlay == true){

      GunAudio();
   }
}

function GunAudio(){
   audioPlay = false;
   audio.Stop();
   audio.clip = shot_sound;
   audio.Play();
   yield WaitForSeconds(shot_sound.length);
   audioPlay = true;
}

Hope this helps

You may consider using audio.PlayOneShot.

function LateUpdate()
{
    if(can_shoot)
    {
        //fire pew pew
        if(shot_sound)
        {
            audio.PlayOneShot(shot_sound);
        }
    }
}

This will cause another sound to play even if another sound is playing. If you're playing sound too often, you might get a very loud experience with so many sounds layered on top of each other - and a performance drop.