I believe your definition is of the word is homophone -- two or more words that sound alike but differ in spelling and in meaning, e.g., some and sum. Homonym is used to describe one of two or more words with the same sound that may have the same spelling, but differ in meaning. Homophones are therefore a subset of homonyms.