Interleave two numpy 1D arrays for stereo audio output

Viewed 1287

I have two numpy float32 arrays:

a = numpy.array(c)
b = numpy.array(d)

and these two represent two mono audio streams.

I'd like to write them to a stereo WAV file using scipy's wavwrite:

scipy.io.wavfile.write(wav_name, sampling_rate, samples)

How can I join the two arrays into one samples 2-d array, and interleave them in order to get a proper stereo WAV at output?

2 Answers
Related