samples2 = w2.readframes(w2.getnframes())
samples1 = [samples1[i:i + 2] for i in range(0, len(samples1), 2)]
samples2 = [samples2[i:i + 2] for i in range(0, len(samples2), 2)]

def bin_to_int(bin):
    as_int = 0
for char in bin[::-1]:
    as_int <<= 8
as_int += ord(char)
return as_int
samples1 = [bin_to_int(s) for s in samples1]
samples2 = [bin_to_int(s) for s in samples2]
samples_avg = [((s1 + s2) / 2) for s1, s2 in zip(samples1, samples2)]
Mixing two audio files together with python