You are correct but it is not based on the sound, just if it starts with a vowel. If one listens to people speak, a common mistake, even I do it from copying the same in others, (depending on what crowd I've been around a lot,) is using an before hour as in 'an hour' though most times people will correctly write 'a hour'.
Who writes "a hour"?
Merriam-Webster seems to specifically disagree with you on both points: the usage of "a" vs "an" is based on the sound of the following word, and "hour" is preceded by "an" since it sounds like a vowel despite starting with a consonant.
> You should use a when the word that follows sounds like it begins with a consonant (‘a dog,’ ‘a balloon’). You should use an if the word that follows sounds like it begins with a vowel (‘an ant,’ ‘an elevator’). Remember that sometimes a word will begin with a vowel but it sounds like a consonant (‘a one-time deal’); in this case you should still use a, rather than an. And in some cases a word will start with a consonant but it sounds like a vowel (’an hour’); in this case you should still use an, rather than a. [1]
[1]: https://www.merriam-webster.com/grammar/is-it-a-or-an