Nearly a million sound machines marketed for babies have been recalled after reports that two customers experienced minor electrical shocks.