Removed BUFFER_FRAMES constant and make it a run-time parameter.