but is it the hubs?
many people are still stuck on the whole hub idea when the "evidence" doesn't seem to point to that. If it only makes the noise in 4wd and not in 2wd then I would have to agree with it being transfer case related. Someone also suggested front driveshaft, but this rotates all the time with the rotation of the front wheels. Bad hub assemblies would be continuous with wheel rotation so the 2wd, 4wd positioning wouldn't be significant.
If possible to test, I would say remove the front driveshaft (make sure to mark it so you can reinstall it correctly) drive around the block in both 2wd and 4wd and see if you hear the noise? If you get the same result, then it is definitely transfer case related.