Thank you again frazzle i found a way to do it with media_play. You only need 2 variables for this.
Check it out:
// The Variablesvar
intromusic; // Is saved to the played mp3
var
volume_music_intro = 100; // volume of the mp3
// Start to play the mp3function intro_music()
{
intromusic = media_play("fx/intro.mp3", NULL,
volume_music_intro); // You see the 2 variables?

}
// The function. Call it when the time is come to fade out.function sound_fade_out() // the function

{
if (media_playing(
intromusic) == 1)
{
while(1) // Its and endless loop if you want to end tte loop write: while (volume_music_intro > 0)
{
media_tune(
intromusic,
volume_music_intro, 0, 0); // This changes the volume because volume_music_intro -= 2 * time;
wait(1);
volume_music_intro -= 2 * time; // Thats the fade out command
if (
volume_music_intro <= 0) // If volume_music_intro´s value get 0 or lower the media stops.
{
media_stop(
intromusic);
}
}
}
}