Exemplo n.º 1
0
        public void AddingFormatsOfDifferentLengthThrows()
        {
            GcAdpcmChannel[] channels  = GenerateAudio.GenerateAdpcmSineWave(100, 2, 48000).Channels;
            GcAdpcmChannel[] channels2 = GenerateAudio.GenerateAdpcmSineWave(200, 2, 48000).Channels;
            var adpcm  = new GcAdpcmFormat(new[] { channels[0] }, 48000);
            var adpcm2 = new GcAdpcmFormat(new[] { channels2[1] }, 48000);

            Exception ex = Record.Exception(() => adpcm.Add(adpcm2));

            Assert.IsType <ArgumentException>(ex);
        }
Exemplo n.º 2
0
        public void AddingFormatsTogether()
        {
            GcAdpcmChannel[] channels = GenerateAudio.GenerateAdpcmSineWave(100, 2, 48000).Channels;

            var           adpcm    = new GcAdpcmFormat(new[] { channels[0] }, 48000);
            var           adpcm2   = new GcAdpcmFormat(new[] { channels[1] }, 48000);
            GcAdpcmFormat combined = adpcm.Add(adpcm2);

            Assert.Equal(adpcm.Channels[0], combined.Channels[0], new GcAdpcmChannelComparer());
            Assert.Equal(adpcm2.Channels[0], combined.Channels[1], new GcAdpcmChannelComparer());
        }