示例#1
0
    /// <summary>
    /// Stops a playing sound.
    /// </summary>
    /// <param name="instance">An instance handle from a prior call to PlaySound().</param>
    /// <param name="fadeTime">The amount of time (in seconds) to fade out the sound's volume.</param>
    public static void StopSound(SoundInstance instance, float fadeTime = 0)
    {
        int channel;

        if (SoundInstances.TryGetValue(instance, out channel))
        {
            SDL_mixer.Mix_FadeOutChannel(channel, GetFadeTimeMs(fadeTime));
        }
    }