Comparing the loudness of two samples
This is tricky. Loudness is a very complicated perceptual phenomenon and playback of sound in a room is a very complicated physical phenomenon. To do this right, you would need calibrated sound pressure signal measurements at the listener's ears and then run these through a suitable perceptual model (here is a good overview article: http://www.tcelectronic.com/media/1014016/skovenborg_2004_loudness_m.pdf)

For sine waves you could use the ISO 226 curves but with calibrated signal they are only correct for 1kHz. Let's say compare to sine waves at 200 Hz and one has ten times the amplitude: If playing back the first one 30 dB SPL the second one will be about 4 times louder. If you do this at 80 dB SPL the second will only be 3 times as loud at best. This gets even more complicated when multiple frequencies are involved.

Things get a lot more messy if you include the playback system as well. For pure sine waves the perceived loudness (and energy at the ears) can vary by as much as 30 dB (factor of 8 or so) just by moving a few centimeters. That's a basic effect of room acoustics. Furthermore most playback systems are fairly non flat (either by design or by sloppiness). Most cheap set of computer speakers will not provide a lot of output at 10 kHz.

Your best shot is probably to assume the signal are "normal" (music, speech, something broad band), apply an A-weighting, assume some average playback level and calculate a loudness difference from there. This is a gross simplification but depending on the application this may or may not be good enough.