Пример #1
0
        public void FadeOutChannel()
        {
            InitAudio();
            int    result   = SdlMixer.Mix_GroupChannels(0, 7, 1);
            IntPtr chunkPtr = SdlMixer.Mix_LoadWAV("test.wav");

            result = SdlMixer.Mix_FadeOutChannel(1, 100);
            Thread.Sleep(500);
            Console.WriteLine("PlayChannel: " + result.ToString());
            Assert.IsTrue(result != -1);
            QuitAudio();
        }
Пример #2
0
        public void FadingChannel()
        {
            InitAudio();
            int    result;
            int    resultFading;
            IntPtr chunkPtr = SdlMixer.Mix_LoadMUS("test.wav");

            result       = SdlMixer.Mix_PlayChannel(1, chunkPtr, -1);
            resultFading = SdlMixer.Mix_FadingChannel(1);
            //Console.WriteLine("FadingMusic1: " + resultFading.ToString());
            Assert.AreEqual(resultFading, SdlMixer.MIX_NO_FADING);
            result       = SdlMixer.Mix_FadeOutChannel(1, 1000);
            resultFading = SdlMixer.Mix_FadingChannel(1);
            Assert.AreEqual(resultFading, SdlMixer.MIX_FADING_OUT);
            //Console.WriteLine("FadingMusic2: " + resultFading.ToString());
            Thread.Sleep(2000);
            resultFading = SdlMixer.Mix_FadingChannel(1);
            Assert.AreEqual(resultFading, SdlMixer.MIX_NO_FADING);
            //Console.WriteLine("FadingMusic: " + resultFading.ToString());
            Assert.IsTrue(result == 1);
            QuitAudio();
        }