Quote from David's link:
The extended gain analysis tables in Foobar2000 (and the derivatives that copied it) are wrong.
Here is how to show that it's wrong. Use <http://www.daniweb.com/software-development/python/code/263775> to create
a 1 kHz signal using a 48 kSamples/sec rate (48.wav) and and a 192
kSamples/sec rate (192.wav). I modified the script to generate 2s of
samples.
Because the underlying signal is the same (1kHz with a fixed amplitude) the perceived loudness should be identical,
independent of the sampling rate.
Is it?
I used that messy script, which shows itself on Google on multiple places, just to confirm that we are talking about same thing, but that's not the way to treat Python. Numpy exists for reason, even if someone's testing procedure is limited on only two audio files. It's just a shame to use bare Python for audio testing.
Assuming:
import numpy
from scipy.io import wavfile
from scipy.signal import chirp
Here are some oneliner functions to bake the data, just follow your imagination, it's fast and easy:
def np_tone(fs, freq=440, t=2): return np.array(16384*np.cos((2*np.pi*freq/fs)*np.arange(fs*t)), dtype=np.int16)
def np_rand(fs, t=2): return np.array(16384*np.random.random_sample(fs*t), dtype=np.int16)
def np_chirp(fs, t=2): return np.array(16384*chirp(np.linspace(0, t, fs*t), fs/2, .002, t), dtype=np.int16)
then create for example 1 kHz tone in stereo (double mono):
data = np_tone(44100, freq=1000)
wavfile.write('44100.wav', 44100, np.column_stack((data, data)))
BTW, RG for some reason does not work for 176400 both with wvgain, and with same table: http://goo.gl/JwxaT using other tool. Perhaps coefficients are bad for that rate.