fade out music?

Started by YotamElal, Wed 04/05/2005 16:02:23

Previous topic - Next topic

YotamElal

how do I fade out music?

GarageGothic

I can't see any GetMusicVolume command, so try this:

int vol = 100 (or whatever the music volume was);
while  vol > 0 {
  SetMusicVolume (vol);
  vol--;
  wait(1);
  }

YotamElal

SetMusicVolume doesn't work but SetMusicMasterVolume should work.
But there is no change of volume????
?


Ashen

SetMusicVolume () can only have values from -3 to 3, which is why it didn't work.
Since SetMusicMasterVolume () isn't working either - bear in mind there are a few different Set...Volume() commands, depending on what you want to change the volume of. Try them all (or look them up and see which you want):
SetMusicVolume () [-3 -> 3]
SetMusicMasterVolume () [0 -> 100]
SetDigitalMasterVolume () [0 -> 100]
SetSoundVolume () [0 -> 255]
SetSpeechVolume () [0 -> 255]

Also, where have you put GG's code? It's possible it just isn't being called at the right time.
I know what you're thinking ... Don't think that.

YotamElal

I want to use SetMusicMasterVolume () but it doen't work.

the code is in after-fadein section.

YotamElal

Someone please help..?
My game is finished and this is one of the last things I need!

strazer

Are you sure the music is playing in the music channel? Which command do you use to play the music?

YotamElal


strazer

Are you sure the code executed at all? Try putting a Display command there to check.

Just so we're clear, you have this:

Code: ags

  int vol = 100;
  while (vol >= 0) {
    SetMusicMasterVolume(vol);
    vol--;
    Wait(1);
  }


in the "Player enters screen (after fadein)" interaction of your room, right?

YotamElal

I used the code u gave me and added a display() after it and the display loaded after a sec and the music volume didn't change.
& the code is in (after fadein)


SMF spam blocked by CleanTalk