Added delay and gain controls to capture script.