Parrots do not have vocal cords, so sound is accomplished by expelling air across the mouth of the bifurcated trachea. Different sounds are produced by changing the depth and shape of trachea. So, talking parrots are really whistling in different variations. This ability has made them prized as pets from ancient time to now. In The Masnavi, a writing by an author from Afghanistan, 1250 CE, the author talks about an ancient method for training parrots to speak.
“Parrots are taught to speak without understanding the words. The method is to place a mirror between the parrot and the trainer. The trainer, hidden by the mirror, utters the words, and the parrot, seeing his own reflection in the mirror, fancies another parrot is speaking, and imitates all that is said by the trainer behind the mirror.”