The author of Hebrews 11:4 is very likely referring/alluding to Gen 4:10 -
“What have you done?” replied the LORD. “The voice of your brother’s
blood cries out to Me from the ground.
This "voice" is clearly not a literal voice but the exemplary life of Able, though dead, remains in people's memories to show the glory of God. In fact, the NT continues to use the example of Able's righteousness to teach us because he is always called "righteous":
- Matt 23:35 - And so upon you will come all the righteous blood shed on earth, from the blood of righteous Abel to the blood of Zechariah son of Berechiah, whom you murdered between the temple and the altar.
- 1 John 3:12 - Do not be like Cain, who belonged to the evil one and murdered his brother. And why did Cain slay him? Because his own deeds were evil, while those of his brother were righteous.
- Heb 11:4 - By faith Abel offered to God a more excellent sacrifice than Cain, by which he obtained witness that he was righteous, God testifying of his gifts: and by it he being dead yet speaks.
Thus, Hebrews speaks of the example of the righteousness of Able still teaching is about the benefits of faith in God.
Finally, note that the same author of Hebrews also mentions Able in a similar context in Heb 12:24 -
to Jesus the mediator of a new covenant, and to the sprinkled blood
that speaks a better word than the blood of Abel.
Thus, again, an inanimate object, "the sprinkled blood of the new covenant", speaks. Thus, we have another example of the personification of the inanimate. That is, the Bible authors were capable of figurative language.
====================================
APPENDIX - text matter
There is a slight variation in the Greek text of Heb 11:4 - the final word in most version is λαλεῖ but some have λαλεῖται. Barnes comments on this as follows:
And by it he, being dead, yet speaketh - Margin, "Is yet spoken of."
This difference of translation arises from a difference of reading in
the mss. That from which the translation in the text is derived, is
λαλεῖ lalei - "he speaketh." That from which the rendering in the
margin is derived, is λαλεῖται laleitai - "is being spoken of;" that
is, is "praised or commended." The latter is the common reading in the
Greek text, and is found in Walton, Wetstein, Matthzei, Titman, and
Mill; the former is adopted by Griesbach, Koppe, Knapp, Grotius,
Hammond, Storr, Rosenmuller, Prof. Stuart, Bloomfield, and Hahn, and
is found in the Syriac and Coptic, and is what is favored by most of
the Fathers. See "Wetstein." The authority of manuscripts is in favor
of the reading λαλεῖται laleitai - "is spoken of." It is impossible,
in this variety of opinion, to determine which is the true reading,
and this is one of the cases where the original text must probably be
forever undecided.