It's pretty much random. The key way into figuring out which voice you want for your sim is in CAS (while changing clothes and listening to their "input" for the outfits). If the sim generates with a voice that you don't like, then you can always cancel making that sim and start over with a new one until you recognize the voice you want.
I made sure once I found the female voice type I liked for some of my sims to write down the Character Voice number of a sim that had it in SimPE, and input it for select sims to use that voice in-game. I do this on most occasions when I forget to cycle through CAS sims until that sim has the voice type. :angel:
It doesn't work well when changing Female voices to Male, or between different age groups (i.e. Toddler to Teen)... and vice versa. (I mean it
can, but in some cases it doesn't work.)