Esempio n. 1
0
        public void BrstmLoopAlignmentIsSet()
        {
            GcAdpcmFormat audio = GenerateAudio.GenerateAdpcmSineWave(BuildParseTestOptions.Samples, 1, BuildParseTestOptions.SampleRate);

            audio = audio.WithLoop(true, 1288, 16288);
            var writer = new BrstmWriter {
                Configuration = { LoopPointAlignment = 700 }
            };

            byte[]       builtFile   = writer.GetFile(audio);
            IAudioFormat parsedAudio = new BrstmReader().ReadFormat(builtFile);

            Assert.Equal(1400, parsedAudio.LoopStart);
            Assert.Equal(16400, parsedAudio.LoopEnd);
        }
Esempio n. 2
0
        public void IdspAlignsLoopToBlock(bool loops, int startIn, int endIn, int startOut, int endOut, int blockSize)
        {
            GcAdpcmFormat audio = GenerateAudio.GenerateAdpcmSineWave(BuildParseTestOptions.Samples, 2, BuildParseTestOptions.SampleRate);

            audio = audio.WithLoop(loops, startIn, endIn);

            var config = new IdspConfiguration {
                BlockSize = blockSize
            };

            byte[] idsp    = new IdspWriter().GetFile(audio, config);
            var    decoded = (GcAdpcmFormat) new IdspReader().ReadFormat(idsp);

            Assert.Equal(startOut, decoded.LoopStart);
            Assert.Equal(endOut, decoded.LoopEnd);
        }