when you hear the cocks crowing, ask Allah for some of His grace, for they have seen as angel; but when you hear an ass braying, seek refuge in Allah from the devil, for it has seen the devil. (Using translation from Abū Dāʾūd 5102)
عَنِ النَّبِيِّ ﷺ قَالَ إِذَا سَمِعْتُمْ أَصْوَاتَ الدِّيَكَةِ فَإِنَّهَا رَأَتْ مَلَكًا فَاسْأَلُوا اللهَ وَارْغَبُوا إِلَيْهِ وَإِذَا سَمِعْتُمْ نُهَاقَ الْحَمِيرِ فَإِنَّهَا رَأَتْ شَيْطَانًا فَاسْتَعِيذُوا بِاللهِ مِنْ شَرِّ مَا رَأَتْ