Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Author Topic: fading out a song  (Read 3249 times)

0 Members and 1 Guest are viewing this topic.

Stucki

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Posts: 325
  • I'm a llama!
    • View Profile
    • Schach-Welten
fading out a song
« on: January 17, 2006, 04:56:43 PM »

fading out music.
Hi everybody and a happy new year .... lately
i am back with a question.

i want to fade out a song at a point of the game but i do not know how to do it.
i start the song with -Game.PlayMusicChannel(1,"music\Kapitel_1.ogg", false);
okay i could stop it the same way, but i want to softly fade out the song.
whats to do ???

Greets
Stucki

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: fading out a song
« Reply #1 on: January 17, 2006, 07:00:03 PM »

HI Stucki,

you can for example write a script which will set the volume down

#include "scripts/base.inc"

var cvolume = Game.GetMusicChannelVolume(1);

while (cvolume > 0)
{
   cvolume = cvolume - 1;
   Game.SetMusicChannelVolume(1,cvolume);
   Sleep(some time according to desired speed of fadeout);
}

Then attach your script when necessary through
Scene.AttachScript(path to your new file);

Better way will be if you make an object for this but it depends how heavily you will use this functions. ;)

Hope that helps.

Ps. entirely untested because I am still sitting at work but you can give it a try.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

Stucki

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Posts: 325
  • I'm a llama!
    • View Profile
    • Schach-Welten
Re: fading out a song
« Reply #2 on: January 18, 2006, 05:53:22 PM »

its working fine.
thanks alot you saved my day.....

Greets stucki
 

Page created in 0.039 seconds with 21 queries.