So for an explanation, this line will not choose all sounds.
var n = randi() % (footstepsNormal.size() - 1) + 1
Assuming there are 6 sounds, you find a random number of the space of 6 - 1, which is 5, then add 1. So the randi() statement generates some huge random integer number, the modulus 5 then restricts it to the numbers 0, 1, 2, 3, 4 and then you add 1. Which means the value of n can only be 1, 2, 3, 4, or 5. Meaning it will never play the first sound.
footstepsNormal[n] = footstepsNormal[0]
footstepsNormal[0] = self.stream
These 2 lines take the first sound in the array and swaps it with the index of the random sound that just played. This is not an error, but it does absolutely nothing. Since the first code snippet (above) chooses a random sample, the order of the array is irrelevant. So it just makes things confusing for no reason, and does not change the functionality of the code.