We investigate the scaling properties of the Barkhausen effect, recording the noise in several soft ferromagnetic materials: polycrystals with different grain sizes and amorphous alloys. We measure the Barkhausen avalanche distributions and determine the scaling exponents. In the limit of vanishing external field rate, we can group the samples in two distinct classes, characterized by exponents \tau = 1.50 \pm 0.05 or \tau = 1.27 \pm 0.03, for the avalanche size distributions. We interpret these results in terms of the depinning transition of domain walls and obtain an expression relating the cutoff of the distributions to the demagnetizing factor which is in quantitative agreement with experiments.