/// <summary> /// Plays the music sample, starting from a specific /// position and fades it in /// </summary> /// <param name="numberOfTimes"> /// The number of times to play. /// Specify 1 to play a single time, -1 to loop forever. /// </param> /// <param name="milliseconds"> /// The number of milliseconds to fade in for /// </param> /// <param name="position"> /// A format-defined position value. /// For Ogg Vorbis, this is the number of seconds from the /// beginning of the song /// </param> public static void FadeInPosition(int numberOfTimes, int milliseconds, double position) { if (SdlMixer.Mix_FadeInMusicPos(m_CurrentMusic.Handle, numberOfTimes, milliseconds, position) != 0) { throw SdlException.Generate(); } }
public void FadeInMusicPos() { InitAudio(); int result; IntPtr chunkPtr = SdlMixer.Mix_LoadMUS("test.wav"); result = SdlMixer.Mix_FadeInMusicPos(chunkPtr, -1, 2, 1); Console.WriteLine("PlayMusic: " + result.ToString()); Assert.IsTrue(result != -1); Thread.Sleep(5000); QuitAudio(); }