It’s one of the simplest operations that can be performed upon audio streams, so yes. Mixing two PCM streams (assuming the same sampling rate, bit-depth, and sign) is done simply by generating a new stream, each of whose samples is the mean of the corresponding two samples from the respective source files, i.e. output(sampleNumber)=(stream1(sampleNumber)+stream2(sampleNumber))/2.
Ok, but what you describe here is creating a mono stream from stereo, correct? What I need is to mix two stereo streams.
Quote from: AltAudio on 19 April, 2012, 11:41:53 AMOk, but what you describe here is creating a mono stream from stereo, correct? What I need is to mix two stereo streams.I was referring to your mixing one stream from two, those being your actual stereo stream and the doubled-up stereo version of your mono stream.pdq has a good point, but the same ‘algorithm’ should work just as well for arrays consisting of alternating left and right samples.
I am a .NET developer and I've got an algorithm that converts stereo stream into mono(for simplicity sake) and evaluates those samples with algo logic. It then creates a new stream(in this case) mono and now I've got to mix the two back together into a new stereo stream.