Exemplo n.º 1
0
        public void Can_Write_And_Read_Back()
        {
            var fixture  = new AudioSampleBuffer(2, 1024);
            var writePtr = fixture.GetWritePointer(0);

            (*writePtr) = 126.0f;

            Assert.AreEqual(126.0f, *fixture.GetReadPointer(0));
            fixture.Dispose();
        }
Exemplo n.º 2
0
        public void Can_Clear_Single_Channel()
        {
            var numSamples = 1024;

            using (var fixture = new AudioSampleBuffer(3, numSamples))
            {
                var readPtr  = fixture.GetReadPointer(1);
                var writePtr = fixture.GetWritePointer(0);
                for (var i = 0; i < 3 * 1024; ++i)
                {
                    *writePtr++ = 127.0f;
                }
                Assert.AreEqual(127.0f, *readPtr);
                fixture.ClearChannel(1);
                Assert.AreEqual(0f, *readPtr);
            }
        }