for x in range(datasize):
    sine_list.append(math.sin(2 * math.pi * freq * (x / frate)))
wav_file = wave.open(fname, 'w')
nchannels = 1
sampwidth = 2
framerate = int(frate)
nframes = datasize
comptype = 'NONE'
compname = 'not compressed'
wav_file.setparams((nchannels, sampwidth, framerate, nframes, comptype,
    compname))
for s in sine_list:
    wav_file.writeframes(struct.pack('h', int(s * amp / 2)))
wav_file.close()
frate = 44100.0
freq = 987.0
seconds = 3
data_length = frate * seconds
fname = 'WaveTest2.wav'
make_sine(freq, data_length, fname)
Как мне создать серию звуковых сигналов высокого и низкого тона с помощью Ruby или Python?