The seven priests bearing the seven trumpets of rams' horns before the ark of Yahweh went on continually, and blew the trumpets: and the armed men went before them; and the rearward came after the ark of Yahweh, [the priests] blowing the trumpets as they went.
Now how did Joshua know that? It didn't happen for several hundred years, but you will read in first Kings, the sixteenth chapter, and the thirty-fourth verse where the king decided to rebuild the city of Jericho, and they started building it in the time of his firstborn son. Then when his youngest son was born, they set the gate of the city of Jericho. The prophecy here of Joshua was literally fulfilled. The man was cursed also, so the whole prophecy was fulfilled. "