Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:20:7

And if you speak aloud - then indeed, He knows the secret and what is ˹even˺ more hidden.  

And should you be loud in your speech, in remembrance ˹of God˺ or supplication, then God has no need for this to be ˹spoken˺ loud, then indeed He knows the secret and ˹that which is˺ yet more hidden, than that ˹secret˺, namely, that which the soul whispers ˹to itself˺ and that which occurs to the mind but which you do not speak of ˹to anyone˺, so do not strain yourself to be loud ˹in your speech˺.
القرآن:٢٠:٧

وَإِنْ تَجْهَرْ بِالْقَوْلِ فَإِنَّهُ يَعْلَمُ السِّرَّ وَأَخْفَى  

{وإن تجهر بالقول} في ذكر أو دعاء فالله غني عن الجهر به {فإنه يعلم السر وأخفى} منه: أي ما حدثت به النفس وما خطر ولم تحدث به فلا تجهد نفسك بالجهر.