You don't need the audioOnly variable in here, so maybe move that test and early return just after the "var data = " ... line?