Pronouncing niyyah or niat or intention before performing salah is sunnah as per convention between ulama from madzab As-Syafi’i and madzab Hambali. The redaction for example, for Fajr or Subuh prayer:
اُصَلّى فَرْضَ الصُّبْحِ رَكْعَتَيْنِ مُسْتَقْبِلَ الْقِبْلَةِ اَدَاءً مَأْمُوْمًا ِللهِ تَعَالَى
Usholli fardha as-subhi rak’atayni mustaqbila al-qiblati ada-an ma’muman lillahi ta’ala
I intend to pray Fardu Fajr two rak’ahs facing the Qibla as ma’mum because of Allah Ta’ala
Reason: Sometimes, because not focusing on prayer, we did mistakes by pronouncing the wrong intention that differs from our heart voice. It means we are not concentrated to Allah at that time. By pronouncing it, whenever it does not align with our hearts, we will hear and try to fix it.
Al-Qiyas for hadith Nabi
عَنْ أَنَسٍ رَضِيَ الله ُعَنْهُ قَالَ سَمِعْتُ رَسُوْلَ اللهِ صَلَّى الله ُعَلَيْهِ وَسَلّمَ يَقُوْلُ لَبَّيْكَ عُمْرَةً وَحَجًّاً
“From Anas r.a. said: I heard Rasullah peace be upon him saying, “Labbaika, I deliberately do Umrah and Hajj”. (HR. Muslim).
From this hadith, Ulama takes qiyas or analogy to pronounce the intention of prayer.
Imam Ramli also gives his opinion in his book as follow:
وَيُنْدَبُ النُّطْقُ بِالمَنْوِيْ قُبَيْلَ التَّكْبِيْرِ لِيُسَاعِدَ اللِّسَانُ القَلْبَ وَلِأَنَّهُ أَبْعَدُ عَنِ الوِسْوَاسِ وَلِلْخُرُوْجِ مِنْ خِلاَفِ مَنْ أَوْجَبَهُ
“It is pronounced to recite the intention before takbir (prayer) so that the mouth can help (the solemnness) of the heart, so as to avoid the disruption of the heart and because it avoids differences of opinion which oblige to recite the intention”. (Nihayatul Muhtaj, juz I,: 437)
Rasulullah also said that every action depends on the intention. Rasul did not order to say it aloud, but also did not order to say it only in the heart.
Syaikh Hasan Ali As-saqqaf Al Quraishi Al-Hasyimi. Sifat shalat nabi yang shahih.
H.M.Cholil Nafis, MA. Melafalkan Niat dalam Shalat. Retrieved November 15, 2019 from https://islam.nu.or.id/post/read/11269/melafalkan-niat-dalam-shalat