David recited his scripture and glorified Allah while the mountains joined him in praise and the birds rallied around him. Almighty Allah directed: Be patient (0 Muhammad) of what they say, and remember Our slave David, endued with power. Verily, he was ever oft-returning in all matters and in repentance (toward Allah.) Surah 38: 17
David's sincerity was not the only factor responsible for the birds and beasts joining with him in glorifying Allah, nor was the sweetness of his voice. It was a miracle from Allah. This was not his only miracle, for Allah also endowed him with the faculty of understanding the languages of birds and animals.