We are not told where the people were who were able to hear this voice. The Lord declares that they were spared “because [they] were more righteous” than the people of the destroyed cities. That would have been a declaration for the majority of the population, but there were probably still those who heard the voice, but who might still need to repent.
The idea that there were a people who were more righteous suggests that perhaps this account comes from the land Bountiful, which appears to have been largely spared. Bountiful was the land to which the Nephites had retreated to finally defeat the Gadiantons, a defeat that was attributed to their righteousness. Thus, it is possible that there remained a concentration of believers in Bountiful, which would fit the Lord’s description of those spared due to righteousness.
It is also important to note that while God declares that there has been great destructions, and that the effect of those destruction would obviously generate fear in those who survived, God also offers his hand: “[R]eturn unto me, and repent of your sins, and be converted, that I may heal you.” Those who survived might have been more righteous, but God desired even greater obedience.