As many have pointed here Mandarin, Thai, Cantonese and Vietnam are tonal languages and the meaning of words are depending on how you speak the syllables inside the words. Mandarin has four, Thai has five, Cantonese has six and Vitnamese has six tones. Overall about 20% or 1.5 billion of the world's population converse daily in tonal languages. It will be very helpful if someone come up with automatic tonal detection…
I got curious about something with tonal languages: how are song melodies written for them. For some, the melody matched the tones of the word. Then there's Mandarin. Mandarin just follows the melody, and you can figure out the word by context. As an English speaker, this makes ~cents~ sense. Homophones aren't a big deal. If Mandarin doesn't need tones in lyrics, why does it need them normally?
There are therefore an enormous number of homophones in Mandarin, which makes it very challenging to comprehend without context. I've often had native speaking friends eavesdrop on a conversation, only to tell me that they're not sure what is being discussed.
It also means that the language cannot be usefully written phonetically, and thus unique characters are required.
some discussion here:
https://chinese.stackexchange.com/questions/40574/why-does-m...
https://chinese.stackexchange.com/questions/39695/does-chine...
https://chinese.stackexchange.com/questions/14596/how-many-s...