Please login or register.

Login with username, password and session length
Advanced search  

News:

This forum provides RSS feed. To query recent posts use this url. More...


Author Topic: Crossfade and Pause?  (Read 2441 times)

0 Members and 1 Guest are viewing this topic.

MrArgh

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 4
    • View Profile
Crossfade and Pause?
« on: April 21, 2010, 03:00:39 PM »

Hello!

I'm quite new to Wintermute and is currently working on a small project. I have unfortunately run into a problem:

I have a background music playing in channel 0. When the player interacts with objects I want to crossfade channel 0 to channel 1. So, my background music fades into another song.
After a while I want the music to fade back - so that my original background music is the one playing. My problem is that I want the original music to continue from where it stopped and not start over from the beginning.
Basically, what I want is:

Channel 0 - Play
Channel 1 - Fade in and Channel 0 - Fade Out.
Channel 1 - Play
Channel 0 - Fade in and resume from where it stopped (or continue to play it at volume zero) and channel 1 fade out.

The important thing is the fade - I don't want to stop the music suddenly and that my background piece continues.
Help is very much appreciated =)
Logged

Spellbreaker

  • Supporter
  • Frequent poster
  • *
  • Karma: 4
  • Offline Offline
  • Gender: Male
  • Posts: 376
    • View Profile
    • Apeiron Studios
Re: Crossfade and Pause?
« Reply #1 on: April 21, 2010, 03:08:16 PM »

Hi there.

Crossfading is no problem, see here :

http://docs.dead-code.org/wme/inside_music.html


For the position of the music, you can look here :

http://docs.dead-code.org/wme/generated/scripting_ref_game.html#GetMusicChannelPosition


So it's all possible without problems :)



Greets, Spellbreaker
Logged

MrArgh

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 4
    • View Profile
Re: Crossfade and Pause?
« Reply #2 on: April 21, 2010, 03:14:28 PM »

Thanks for the help!

In SetMusicChannelPosition - is it possible to use a variable as the milliseconds?
I don't want the background music to fade in at the exact same position - instead I want it to fade in where it was stopped.
Perhapss with GetMusicPosition stored as a var?

Edit: Yes, it worked! I used GetMusicChannelPosition to store the position to a variable and then I put that var instead of milliseconds.
Thanks again for the links!
« Last Edit: April 21, 2010, 03:26:12 PM by MrArgh »
Logged
 

Page created in 0.036 seconds with 24 queries.