Mixing Mono Samples with Stereo Samples, Audio DSP using C# |
Mixing Mono Samples with Stereo Samples, Audio DSP using C# |
Apr 19 2012, 06:18
Post
#1
|
|
|
Group: Members Posts: 5 Joined: 19-April 12 Member No.: 98974 |
Hello,
I've got two streams of audio sample that are stored in arrays, one mono and one stereo. I'd like to mix the mono into the stereo stream and output as stereo. Any known examples to accomplish? Thanks in advance.........Mick |
|
|
|
![]() |
Apr 19 2012, 15:32
Post
#2
|
|
|
Group: Members Posts: 5 Joined: 19-April 12 Member No.: 98974 |
How about converting the mono to stereo (two identical tracks) and then mixing normally?
Yes that's reasonable. I could convert the mono easily, so then what is the mixing normally part? Is it fairly straight-forward? |
|
|
|
Apr 19 2012, 16:08
Post
#3
|
|
|
Group: Super Moderator Posts: 4341 Joined: 23-June 06 Member No.: 32180 |
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.
This post has been edited by db1989: Apr 19 2012, 16:20 |
|
|
|
Apr 19 2012, 16:41
Post
#4
|
|
|
Group: Members Posts: 5 Joined: 19-April 12 Member No.: 98974 |
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. |
|
|
|
Apr 19 2012, 17:35
Post
#5
|
|
|
Group: Super Moderator Posts: 4341 Joined: 23-June 06 Member No.: 32180 |
Ok, 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. |
|
|
|
AltAudio Mixing Mono Samples with Stereo Samples Apr 19 2012, 06:18
pdq How about converting the mono to stereo (two ident... Apr 19 2012, 12:49
Speedskater Is this anything like M-S Stereo System? That... Apr 19 2012, 13:40
AltAudio QUOTE (db1989 @ Apr 19 2012, 11:35) QUOTE... Apr 19 2012, 18:11
pdq Don't the stereo streams just contain alternat... Apr 19 2012, 17:25
pdq To create mono from stereo you would take pairs of... Apr 19 2012, 18:27
[JAZ] Could I ask which is your background? I don't ... Apr 19 2012, 19:26
DVDdoug Mick,
Typically, a stereo mixer (hardware or soft... Apr 19 2012, 19:43
AltAudio Ok thanks for the input. I am a .NET developer and... Apr 19 2012, 22:00
DVDdoug QUOTE I am a .NET developer and I've got an al... Apr 20 2012, 00:34![]() ![]() |
|
Lo-Fi Version | Time is now: 22nd May 2013 - 10:16 |