Extract the sample rate reduction and SOX writing code from AVI writing code. Place sample rate reduction to AVI dump control code and split SOX code to its own class.