(31) باب التَّوَسُّطِ فِي الْقِرَاءَةِ فِي الصَّلاَةِ الْجَهْرِيَّةِ بَيْنَ الْجَهْرِ وَالإِسْرَارِ إِذَا خَافَ مِنَ الْجَهْرِ مَفْسَدَةً
Ibn 'Abbas reported:
The word of (Allah) Great and Glorious: 'And utter not thy prayer loudly, nor be low in it" (xvii. 110) was revealed as the Messenger of Allah (may peace beupon him) was hiding himself in Mecca. When he led his Companions in prayer he raised his voice (while reciting the) Qur'an. And when the polytheists heard that, they reviled the Qur'an and Him Who revealed it and him who brought it. Upon this Allah, the Exalted, said to His Apostle (ﷺ): Utter not thy prayer so loudly that the polytheists may hear thy recitation and (recite it) not so low that it may be inaudible to your Companions. Make them hear the Qur'an, but do not recite it loudly and seek a (middle) way between these. Recite between loud and low tone.
Reference: Sahih Muslim 446
In-book reference: Book 4, Hadith 163
USC-MSA web (English) reference(deprecated numbering scheme): Book 4, Hadith 897