I have seen many authors uses "an" before "hour" like "an hour" some times. Please consider the below excerpts.
"How long is your break?", I shouted. A group of labourers sat under the banyan tree near the main campus building. "It's two-thirty, lunch ended an hour ago."
and another one is below
I would take his boat for an hour, and buy him tea and biscuits in return.
' I won't take more than half an hour' I promised.
I learned from my teachers that the article "an" comes before vowels and not before consonants. Here "H" is consonant, still author uses the article "an" before "hour".
My question is, is this "an" before "hour" is acceptable? If yes can you explain why?