#### Archived

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

# I'm searching for an algorythm for crossfading

This topic is 6246 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## 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 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 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 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
Now, set that up and send it to the mixer...

1. 1
Rutin
25
2. 2
3. 3
JoeJ
19
4. 4
5. 5

• 10
• 11
• 9
• 9
• 10
• ### Forum Statistics

• Total Topics
631753
• Total Posts
3002098
×