When I'm passing by pedestrians close, I predict the worst and expect it to happen. So if they dart to the side, I'm ready to stop and avoid a collision. By default, between a bike and a pedestrian, the bike rider is at fault. If I use my voice, I say hello very slowly, and I prolong the second syllable: helloooooooo. As we move through space, they may not hear more than one or two syllables.
And I agree with
choddo that ringing a bell from a distance can be a good way, but you have to plan well.