Archived

This topic is now archived and is closed to further replies.

NoradX

I'm searching for an algorythm for crossfading

Recommended Posts

Hi I'm searching for an allgorythim for crossfading without changing the volume. I've 3 Mp3z, one main mp3, one with strings and one with bass for example, but all mp3z are the same song. It should sound like games from Lucasarts(Monkey Island etc.). The sound shows the actually mood of the character. I'm using OpenGL and C++. I just want an algorhytm for direct sound or a general algorhytm. Hope you will help me. Thanks. Edited by - Noradx on June 12, 2001 1:01:03 PM

Share this post


Link to post
Share on other sites
Oh I''m useing OpenGL and C++.
It would be great if the code is written for direct sound, but general algorythms are also OK.

Thanks again.

Share this post


Link to post
Share on other sites
Can you explain what "crossfading" means????
At first I thought you were talking about making a fade out graphical effect, making it fade like a growing cross!.

What the hells!

Share this post


Link to post
Share on other sites
It''s been a long time since I''ve looked at directsound, but I would imagine it would go something like this:

either:
I thought you couple simply mix sound without raising the overall volume. ie. if you have two sources at full volume, it should be a mix/overlay, not really louder...

or:
if that''s not true, think of full volume at 1.0. When Source A is the only thing playing, it''s volume is 1.0, Source B is at 0.0. When the fade it midway, A = 0.5, B = 0.5. To put it simply, the algorithm just makes sure A + B = 1.0. So, over time, think of a variable AmountOfFade (from A to B).
Volume A = 1.0 - AmountOfFade
Volume B = AmountOfFade
Now, set that up and send it to the mixer...

Share this post


Link to post
Share on other sites