How to average the loudness of a audio file from its amplitude? I would like to average the loudness of different sounds so that their means could be used as a dependent variable in a statistical regression, but I have some troubles to understand how loudness works.  
Assume that I have large number of different audio files that are all recorded in the exact same conditions, so that a same original sound would have the exact same frequency and amplitude in each file.  
I saw that the loudness of a sound is proportional to the square of its amplitude, but also that $\mathrm{dB} = 10\log_{10}(\mathrm{Amp})$. Therefore I do not know which formula to use, and neither if I should first average the amplitude and then apply the formula, or apply the formula first and then average the dB.  
If somebody has some answers or some literature to get me on the right track it would be very helpful.
 A: In general, you would first ensure the signals you are using have no DC component (likely the don't have a DC component), and more specifically, you could choose to band limit the signals to a frequency range of interest; but this may not be necessary. You will also need to ensure that if you are using different signal sources, they are normalized somehow. For loudness specifically (i.e. not just signal energy), it might be necessary to 'A-weight' the signal (i.e. pass through a filter with characteristics that emulate human hearing)
Then you would square the signal (not absolute value) and average over the duration of interest. Human perception of loudness depends on the frequency and other characteristics, so there may not be a direct correlation between the numerical value you obtain and the perception of loudness.
A: I don't think there's a generic physics answer to your question. It depends on what you're trying to accomplish in this analysis. You haven't said whether it's a psychology experiment, or a study of the effect of sound waves on materials, or something else. The reason we often use the dB scale for sounds is that the ear-brain system perceives loudnesses in terms of ratios, and the logarithm converts ratios to differences. "Loudness" is not a physics term. If it's going to have a formal mathematical definition, that would be psychoacoustics, not physics.

so that their means could be used as a dependent variable in a statistical regression

Both a mean and a linear regression are linear things. Whether it makes sense to do these linear operations on a variable depends on whether the variable is naturally structured in a linear way. For example, it makes sense to average celsius temperatures, but it doesn't necessarily make sense to average star ratings on rottentomatoes.
