Tag Info

There are three differences
rhythm
たんい has three morae ("syllables"), where as たに has only two.
sound
たんい has a uvular ("nasal") /ɴ/, i.e. [ta.ɴ.i], whereas たに has a "normal" /n/, i.e. [ta.ni].
pitch
たんい【HLL】 drops in pitch after the first mora, たに【LH】 drops in pitch after the second mora.
Try to listen for all three differences, they're all important.
...

単{たん}is pronounced たん and 位{い}is pronounced い.
Together, they are pronounced たんい or tann-i. This is distinctly different from に or ni.
For example, 谷{たに}is pronounced たに or tani. I don't know phonetic symbols so I apologize but you can sound these two out to hear how they are different.