Audio not looping on Android

I have a bit of a problem playing the audio on a machine gun on Android. The code is from stock machine gun (for the audio part)

function LateUpdate() {
	if (muzzleFlash) {
		// We shot this frame, enable the muzzle flash
		if (m_LastFrameShot == Time.frameCount) {
			muzzleFlash.transform.localRotation = Quaternion.AngleAxis(Random.value * 360, Vector3.forward);
			muzzleFlash.enabled = true;
			
			if (audio) {
				if (!audio.isPlaying)
					audio.Play();
					audio.loop = true;
			}
		} else {
		// We didn't, disable the muzzle flash
			muzzleFlash.enabled = false;
			enabled = false;
			
			// Play sound
			if (audio)
			{
				audio.loop = false;
			}
		}
	}
}

And here’s the code for firing the weapon:

	if (GUI.RepeatButton (new Rect (644, 373,107,107), "", fireStyle)) 
		BroadcastMessage("Fire");

I attached an audio source to the weapon and set it to loop (disabling that option won’t work either).

I am thinking this must have something to do with the RepeatButton code, which I need since the player should keep the button pressed as long as it wants to fire as opposed to short bursts. Any ideas where I might be doing it wrong? Thanks!

I have not tested the above code, but one thing that does stand out to me from the above; is that you are setting the audio to loop after you have already played it. I am not 100% on how Unity handles these things, but try setting the audio.loop to true before you play off the audio.