Im trying to make a gun shoot sound

Hey guys, im trying to make a gun sound script but when i play it it comes after ive shoot! and the sound becomes really weird

  public AudioSource ak47sound;

   if (Input.GetButtonUp("Fire1"))

Change it to “Input.GetButtonDown” instead of up. And then add “if (ak47sound.isPlaying == false)” before you “ak47sound.Play();”