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"))
             {
            
                ak47sound.Play();
                print("RATATATATATA"); 
    
             }

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