This project is read-only.

Upmix stereo to 5.1

Feb 26, 2015 at 1: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?
Feb 26, 2015 at 5:30 PM
Please specify "mixed channels". You've got any code yet?
Feb 27, 2015 at 12:01 AM
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)
    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

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