public void OneInTwoOutShouldConvertMonoToStereo()
        {
            var input1 = new TestSampleProvider(32000, 1);

            float[] expected = new float[] { 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9 };
            var     mp       = new MultiplexingSampleProvider(new ISampleProvider[] { input1 }, 2);

            mp.AssertReadsExpected(expected);
        }
        public void TwoInOneOutShouldSelectLeftChannel()
        {
            var input1 = new TestSampleProvider(32000, 2);

            float[] expected = new float[] { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18 };
            var     mp       = new MultiplexingSampleProvider(new ISampleProvider[] { input1 }, 1);

            mp.AssertReadsExpected(expected);
        }
        public void OneInOneOutShouldCopyInReadMethod()
        {
            var input1 = new TestSampleProvider(32000, 1);

            float[] expected = new float[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
            var     mp       = new MultiplexingSampleProvider(new ISampleProvider[] { input1 }, 1);

            mp.AssertReadsExpected(expected);
        }
        public void ReadReturnsCountIfOneInputHasEndedButTheOtherHasnt()
        {
            var input1 = new TestSampleProvider(32000, 1, 0);
            var input2 = new TestSampleProvider(32000, 1);

            float[] expected = new float[] { 0, 0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7 };
            var     mp       = new MultiplexingSampleProvider(new ISampleProvider[] { input1, input2 }, 2);

            mp.AssertReadsExpected(expected);
        }
        public void TwoInOneOutShouldCanBeConfiguredToSelectRightChannel()
        {
            var input1 = new TestSampleProvider(32000, 2);

            float[] expected = new float[] { 1, 3, 5, 7, 9, 11, 13, 15, 17, 19 };
            var     mp       = new MultiplexingSampleProvider(new ISampleProvider[] { input1 }, 1);

            mp.ConnectInputToOutput(1, 0);
            mp.AssertReadsExpected(expected);
        }
        public void StereoInTwoOutCanBeConfiguredToSwapLeftAndRight()
        {
            var input1 = new TestSampleProvider(32000, 2);

            float[] expected = new float[] { 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10 };
            var     mp       = new MultiplexingSampleProvider(new ISampleProvider[] { input1 }, 2);

            mp.ConnectInputToOutput(0, 1);
            mp.ConnectInputToOutput(1, 0);
            mp.AssertReadsExpected(expected);
        }
        public void TwoMonoInTwoOutShouldCreateStereo()
        {
            var input1 = new TestSampleProvider(32000, 1);
            var input2 = new TestSampleProvider(32000, 1)
            {
                Position = 100
            };

            float[] expected = new float[] { 0, 100, 1, 101, 2, 102, 3, 103, 4, 104, 5, 105 };
            var     mp       = new MultiplexingSampleProvider(new ISampleProvider[] { input1, input2 }, 2);

            mp.AssertReadsExpected(expected);
        }