check real number of channels instead of always assuming 32