Ejemplo n.º 1
0
        public void FadeOutChannel()
        {
            InitAudio();
            int result = SdlMixer.Mix_GroupChannels(0, 7, 1);

            SdlMixer.Mix_LoadWAV("test.wav");
            result = SdlMixer.Mix_FadeOutChannel(1, 100);
            Thread.Sleep(500);
            Console.WriteLine("PlayChannel: " + result.ToString());
            Assert.IsTrue(result != -1);
            QuitAudio();
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Fades out a channel.
 /// </summary>
 /// <param name="ms">
 /// The number of milliseconds to fade out for
 /// </param>
 /// <returns>The number of channels fading out</returns>
 /// <remarks></remarks>
 public int Fadeout(int ms)
 {
     return(SdlMixer.Mix_FadeOutChannel(this.index, ms));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Fades out all channels
 /// </summary>
 /// <param name="milliseconds">
 /// The number of milliseconds to fade out for
 /// </param>
 /// <returns>The number of channels fading out</returns>
 public static int Fadeout(int milliseconds)
 {
     return(SdlMixer.Mix_FadeOutChannel(-1, milliseconds));
 }