The Prophet ﷺ heard a voice coming from a grave and asked, "When did this person die?"They replied, "He died during the time of ignorance."He was pleased by that and said, "Were it not that you would cease to bury one another, I would have prayed to Allah to make you hear the punishment of the grave."
أخبرنا سويد بن نصر قال حدثنا عبد الله عن حميد
أن النبي ﷺ سمع صوتا من قبر فقال متى مات هذا قالوا مات في الجاهلية فسر بذلك وقال لولا أن لا تدافنوا لدعوت الله أن يسمعكم عذاب القبر
[Its chain of transmission is sahih] Ahmad narrated it: 103/3, 114, 201, from the hadith of Humayd Tawil with this wording, and he explicitly stated that he heard it directly in the second narration. Thabit Bunani corroborated him there: 153/3. Ibn Hibban graded it sahih, no. 200, and it is in Kubra, no. 2185. Abdullah is Ibn Mubarak. The hadith has many corroborating narrations with Muslim, no. 2868, and others.