@St.Roymond gave already one possible answer. I can also think of additional ways how God can speak to humans. God has many ways, like giving messages through dreams, through messengers, as ‘internal speak’, like in the case of prophesying, or through lifting revealing images or words into the mind.
I have some background in charismatic circles and have received teaching and some experiences of how God tells messages to believers today. If it happens today in the case of ordinary believers, God certainly could tell revealing messages to those he chose to tell lasting messages.
My current church environment is charismatic in a fairly balanced way. We believe that God acts and speaks even today and encourage telling of what God has spoken but within orderly and sober limits.
Expressions like ‘Thus says the Lord’ are not encouraged and the trained persons never use such expressions because these give a false impression of how prophesying works today. One teacher (pastor) illustrated the phenomenon by telling that half of the spoken prophesy may come from the Lord but the other half comes from the prophesying person. God reveals messages but the way how the prophesying person delivers the message reflects her/his personality and experiences. The core of the message may be accurately from God but the rest of what is spoken could be called ‘the taste of the vessel’.
In the case of revealing images, delivering the message becomes even more subjective because both the receiving person and the listeners need to interpret what the image actually tells. In such cases, use of cautious expressions is wisdom.
We can see this kind of revealing images in Revelation. John was shown something and he wrote what he saw with the words and concepts he knew.
From this background, I can easily imagine how God could have given messages or inspired persons to tell or write something according to the will of the Lord. The message comes from God but how the receiving person tells or writes about the message reflects the language, experiences and worldview of the human. In this way, it happens in cooperation (symphony) between the Spirit of God and the human.
What I wrote above reflects subjective understanding about the topic. You may dismiss it as a ‘heretical’ belief but it shows that there are potential explanations of how God could speak to ancient people in ways that are judged to be outdated by us, the modern readers.