Fix crash on very short wave files by setting min frames to at least 1

This fixes a crash when the wave file is very short and the requested frame size would get set to 0 due to integer division. I just put in a MAX(1, val) in two places that seems to have resolved the problem.