The best way to change the volume would be based on the internal noise, since engine is not the only source of noise. Many cars have considerable noise coming from windows and tires. So you would need to base it off of the noise that a microphone measures. This would be the most ideal way (as well as most complicated). Also, in creating the program, one should remember that the increase is not linear but logarithmic, it might not matter if it is using the volume control of the programs, but even then the volume increase is not always linear.