Upmix stereo to 5.1

Feb 26, 2015 at 12:43 PM
Hi, after a few hours playing with CSCore, I'm now able to play my music with a simple Stream Effect applied on. Now I want to output my "mixed channels" to Center and Rear while keeping L/R untouched. What should I do?
Coordinator
Feb 26, 2015 at 4:30 PM
Please specify "mixed channels". You've got any code yet?
Feb 26, 2015 at 11:01 PM
here's my simple effect code:
Public Class LowerMid
    Inherits SampleSourceBase

    Dim c As Single = 1 / Math.Sqrt(2)
    Dim l, r, m, s As Single

    Public Sub New(source As IWaveStream)
        MyBase.New(source)
    End Sub

    Public Overrides Function Read(buffer() As Single, offset As Integer, count As Integer) As Integer
        Dim n = MyBase.Read(buffer, offset, count)

        For i = offset To offset + n - 1 Step 2
            l = buffer(i)
            r = buffer(i + 1)
            m = (l + r) * c * 0.5
            s = (l - r) * c
            l = (m + s) * c
            r = (m - s) * c
            buffer(i) = l
            buffer(i + 1) = r
        Next

        Return n
    End Function
End Class
I want to output this effect to Rear speakers and keep L/R play the original.