예제 #1
0
        public void SeekTest()
        {
            var r     = new FLACReader("test.flac", null);
            var buff1 = new AudioBuffer(r, 16536);
            var buff2 = new AudioBuffer(r, 16536);

            Assert.AreEqual(0, r.Position);
            r.Read(buff1, 7777);
            Assert.AreEqual(7777, r.Position);
            r.Position = 0;
            Assert.AreEqual(0, r.Position);
            r.Read(buff2, 7777);
            Assert.AreEqual(7777, r.Position);
            AudioBufferTest.AreEqual(buff1, buff2);
            r.Read(buff1, 7777);
            Assert.AreEqual(7777 + 7777, r.Position);
            r.Position = 7777;
            Assert.AreEqual(7777, r.Position);
            r.Read(buff2, 7777);
            Assert.AreEqual(7777 + 7777, r.Position);
            AudioBufferTest.AreEqual(buff1, buff2);
            r.Close();
        }
예제 #2
0
        public void SeekTest()
        {
            var r     = new AudioDecoder(new DecoderSettings(), "alac.m4a");
            var buff1 = new AudioBuffer(r, 16536);
            var buff2 = new AudioBuffer(r, 16536);

            Assert.AreEqual(0, r.Position);
            r.Read(buff1, 7);
            Assert.AreEqual(7, r.Position);
            r.Position = 0;
            Assert.AreEqual(0, r.Position);
            r.Read(buff2, 7);
            Assert.AreEqual(7, r.Position);
            AudioBufferTest.AreEqual(buff1, buff2);
            r.Read(buff1, 7);
            Assert.AreEqual(7 + 7, r.Position);
            r.Position = 7;
            Assert.AreEqual(7, r.Position);
            r.Read(buff2, 7);
            Assert.AreEqual(7 + 7, r.Position);
            AudioBufferTest.AreEqual(buff1, buff2);
            r.Close();
        }
예제 #3
0
        public void SeekTest()
        {
            var r     = new Codecs.libFLAC.DecoderSettings().Open("test.flac", null);
            var buff1 = new AudioBuffer(r, 16536);
            var buff2 = new AudioBuffer(r, 16536);

            Assert.AreEqual(0, r.Position);
            r.Read(buff1, 7777);
            Assert.AreEqual(7777, r.Position);
            r.Position = 0;
            Assert.AreEqual(0, r.Position);
            r.Read(buff2, 7777);
            Assert.AreEqual(7777, r.Position);
            AudioBufferTest.AreEqual(buff1, buff2);
            r.Read(buff1, 7777);
            Assert.AreEqual(7777 + 7777, r.Position);
            r.Position = 7777;
            Assert.AreEqual(7777, r.Position);
            r.Read(buff2, 7777);
            Assert.AreEqual(7777 + 7777, r.Position);
            AudioBufferTest.AreEqual(buff1, buff2);
            r.Close();
        }
예제 #4
0
        public void SeekTest()
        {
            var r     = new ALACReader("alac.m4a", null);
            var buff1 = new AudioBuffer(r, 16536);
            var buff2 = new AudioBuffer(r, 16536);

            Assert.AreEqual(0, r.Position);
            r.Read(buff1, 7);
            Assert.AreEqual(7, r.Position);
            r.Position = 0;
            Assert.AreEqual(0, r.Position);
            r.Read(buff2, 7);
            Assert.AreEqual(7, r.Position);
            AudioBufferTest.AreEqual(buff1, buff2);
            r.Read(buff1, 7);
            Assert.AreEqual(7 + 7, r.Position);
            r.Position = 7;
            Assert.AreEqual(7, r.Position);
            r.Read(buff2, 7);
            Assert.AreEqual(7 + 7, r.Position);
            AudioBufferTest.AreEqual(buff1, buff2);
            r.Close();
        }