The variable says samples but you are now treating it as bytes.  Which is it?

-[Unknown]