A friend of mine and I got into an argument about the usage of "an" and "a." We couldn't come to agreement of whether to use "an" or "a" for this situation: "An m4" or "A m4"

It might seem obvious to use "a" since the first letter of the acronym is a consonant, but I argued that since it was pronounced "em four," that the word "an" be used. He supported his answer by stating, "it doesn't have to sound right to be English," but I argued back that that wasn't the case and that the whole purpose of the word "an" is to enhance how the flow of words sound.

What are your thoughts on the situation?
Welcome to English Forums!

The choice between a and an is based on sound, not on the printed letters themselves.

You need: an m4.

For further details, see The use of an and a.

Students: Are you brave enough to let our tutors analyse your pronunciation?
Thanks for the quick response.
you are correct