The Canadian, 24, had been with the Foxes for three seasons, having made his name with Tranmere Rovers.
Hume scored 34 goals in 134 appearances for Leicester, but was unable to help them escape dropping down to the third tier of English football for the first time in their history last term.
Tykes boss Simon Davey had made the forward his top transfer target for the summer.
"Iain is a big talent who, at the age of 24, is just starting to come into his prime. He is an ambitious player who shares our drive and ambition," he said.
"The staff are excited about having the chance to work with Iain and develop him even further. We know that he will have a big impact at Oakwell and sure he will become a fans' favourite."