0
0

Hi!

[b:2elbqm9t]Problem: When I play a sound effect multiple times – at once, the sound gets louder.[/b:2elbqm9t]

I could for instance do this…
FSOUND_PlaySound(FSOUND_FREE, pMySingleSample);
FSOUND_PlaySound(FSOUND_FREE, pMySingleSample);
FSOUND_PlaySound(FSOUND_FREE, pMySingleSample);

I have a special sound effect which, in some cases, is being played every 20 ms. The sound needs to be mixed with itself, just the way FMOD does, but the volume must not increase. [u:2elbqm9t]Now, how can I make sure that the volume of the mixed sound effects is normalized?[/u:2elbqm9t]

Maybe this is just an illusion, but I still need to solve it somehow.
Thanks.
/Chris, Sweden

  • You must to post comments
0
0

I have been thinking about the amplitude problems when mixing sounds too, and I do not agree completely with your statement that the volume increases automatically when two sounds are added together.
Normally, one would expect that the values of the samples of a sound are centered around 0, so it could be that the addition of two signals results to zero (for example, when they are in counter-phase). This is off course a volume decrease rather than an increase :)

Also, when I mix two sounds together using a hardware mixer, the volume increases only slightly, but when I do this in software (using fmod), I notice a much higher increase in volume, which is rather annoying.

  • You must to post comments
0
0

bambee, did you solve it somehow?

I have an ugly, temporary solution where I halve the volume on the channel the sound was previously played. However, that does not work if the sound is played 3+ times at once.

I’m thinking of storing a list of the channels returned by FSOUND_PlaySound and lower their volume whenever the sample is played again – before it has finished playing. This means that I have to assign specific channels for all my sound effects. Truly an ugly solution.

I’ll try DirectSound and see if it does the same thing.

  • You must to post comments
0
0

If the same sound is being played at the same time, it will create a louder sound. Different sounds may still produce this effect, if and only if they are phased similarly. Otherwise, they will desrtuctivly interfere.

[url=http://www.kettering.edu/~drussell/Demos/superposition/superposition.html:qyl1ywn5]Superposition of Waves[/url:qyl1ywn5]

  • You must to post comments
0
0

[quote="znakeeye":2auoooom]bambee, did you solve it somehow?
[/quote:2auoooom]
Yes, I bought a mixer 😉
I am having the volume problem with a DJ’ing application I wrote, and I give the user a choice to choose between software mixing (in that case, one soundcard is linked to the amp and the other to headphones for prelistening), and hardware mixing (each sound card acts as a deck and mixing and prelistening is done using the mixer). So I prefer the hardware mixer, because it can keep the volume more constant when fading from one song to another, and because you can control the mixer and the player simultaneously (which is hard with mouse and keyboard)
[quote="znakeeye":2auoooom]
I have an ugly, temporary solution where I halve the volume on the channel the sound was previously played. However, that does not work if the sound is played 3+ times at once.

I’m thinking of storing a list of the channels returned by FSOUND_PlaySound and lower their volume whenever the sample is played again – before it has finished playing. This means that I have to assign specific channels for all my sound effects. Truly an ugly solution.

I’ll try DirectSound and see if it does the same thing.[/quote:2auoooom]
Indeed, this is an ugly solution. The real solution should be implemented at signal processing level. However, I have no idea on how the hardware mixer does it.

  • You must to post comments
0
0

Yes, I know that.
But you just presented one of the solutions I’ve been thinking of; normalizing. How can that be done with Fmod-calls?

  • You must to post comments
0
0

desired_volume = current_volume/number_of_times_redundant_data_used

But i gotta say if you want to playsomething many times at exactly the sametime and not get loader then play it once.

  • You must to post comments
Showing 6 results
Your Answer

Please first to submit.