what type is one_frame_ms? Integer? You'd need to either:
one_frame_ms := buffsize div bits div freq
or you could
one_framce_ms := trunc(buffsize / bits / freq)

and you might want to consider using brackets just to be extra sure you don't cause a bug that may be marginally annoying