How can I mix two sounds with PyAudio into one. I browsed all over internet but nobody answered this question. I was also thinking about using audiolab or swMixer, but they dont support Python 3.4... I was thinking about converting they byte string into numpy array, merging it with another, and converting back to by string. Is that possible?
wf1 = wave.open("YYY.wav", 'rb')
wf1 = wave.open("XXX.wav", 'rb')
p = pyaudio.PyAudio()
def callback(in_data, frame_count, time_info, status):
data1 = wf1.readframes(frame_count)
data2 = wf2.readframes(frame_count)
#Here i need to mix these two byte strings together
return (data, pyaudio.paContinue)
You are my last hope, thank you for any advance!