Language:
كتاب الجنائز
23  
Funerals (Al-Janaa'iz)
(90)
Chapter: The speech of the deceased upon the bier
(90)
باب كَلاَمِ الْمَيِّتِ عَلَى الْجَنَازَةِ
Sahih al-Bukhari 1380

Narrated Abu Sa`id Al-Khudri:

Allah's Messenger (ﷺ) said, "When the funeral is ready (for its burial) and the people lift it on their shoulders, then if the deceased is a righteous person he says, 'Take me ahead,' and if he is not a righteous one then he says, 'Woe to it (me)! Where are you taking it (me)?' And his voice is audible to everything except human beings; and if they heard it they would fall down unconscious . "

حَدَّثَنَا قُتَيْبَةُ، حَدَّثَنَا اللَّيْثُ، عَنْ سَعِيدِ بْنِ أَبِي سَعِيدٍ، عَنْ أَبِيهِ، أَنَّهُ سَمِعَ أَبَا سَعِيدٍ الْخُدْرِيَّ ـ رضى الله عنه ـ يَقُولُ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏ "‏ إِذَا وُضِعَتِ الْجَنَازَةُ فَاحْتَمَلَهَا الرِّجَالُ عَلَى أَعْنَاقِهِمْ، فَإِنْ كَانَتْ صَالِحَةً قَالَتْ قَدِّمُونِي قَدِّمُونِي‏.‏ وَإِنْ كَانَتْ غَيْرَ صَالِحَةٍ قَالَتْ يَا وَيْلَهَا أَيْنَ يَذْهَبُونَ بِهَا‏.‏ يَسْمَعُ صَوْتَهَا كُلُّ شَىْءٍ إِلاَّ الإِنْسَانَ، وَلَوْ سَمِعَهَا الإِنْسَانُ لَصَعِقَ ‏"‏‏.‏
Reference : Sahih al-Bukhari 1380
In-book reference : Book 23, Hadith 132
USC-MSA web (English) reference : Vol. 2, Book 23, Hadith 462
  (deprecated numbering scheme)