0
0

Hello, I’m getting sound popping for 3D sounds that are played at a distance (so when their volume is low). The problem seems to be that the sounds are being played at full volume for a very short time, before the proper low volume is applied, producing the popping sound.

I’m using FMOD Studio 1.03.

Now some code in case I’m doing something wrong.

Here is how I’m initializing FMOD:

[code:1vi20j0w]
result = _system->init(512, FMOD_INIT_NORMAL | FMOD_INIT_VOL0_BECOMES_VIRTUAL, 0);
/* */
_system->createChannelGroup("effects", &_effects_channel);
[/code:1vi20j0w]

Here is how I’m initializing sounds:

[code:1vi20j0w]
LOG_ERROR(_system->createSound(("audio\" + filename).c_str(),
FMOD_3D | FMOD_3D_LINEARROLLOFF,
0, &sound));

    if (sound){
        LOG_ERROR(sound->set3DMinMaxDistance(320 * DISTANCEFACTOR, 1500.0f * DISTANCEFACTOR));

[/code:1vi20j0w]

And here is how I’m playing sounds:
[code:1vi20j0w]
FMOD::Channel *channel = NULL;

        LOG_ERROR(_system->playSound(sound, _effects_channel, true, &channel));
        if (channel){
            FMOD_VECTOR position;
            FMOD_VECTOR vel;
            vel.x = vel.y = vel.z = 0;
            if (play3d){
                position.x = pos.x;
                position.y = pos.y;
                position.z = pos.z;
            } else {
                position.x = 0;
                position.y = 0;
                position.z = 0;
                channel->setMode(FMOD_3D_HEADRELATIVE);
            }
            LOG_ERROR(channel->set3DAttributes(&position, &vel));
            LOG_ERROR(channel->setPaused(false));
        }

[/code:1vi20j0w]

Now, I’ve found a workaround, which is to add 5ms of silence to the start of every sound. However this adds unnecessary latency to the game sound events, which is a huge letdown.

  • You must to post comments
0
0

Thank you! That was it :)

  • You must to post comments
0
0

Hi, we’re just fixing this for the next release, yes the volume ramp was set up correctly at pause / play time, but the first update resets the volume ramp from 1.0 to 0.0 if the mixer hadnt been updated yet, so you could get that pop noise. The new one fixes the ramp at pause time. You will want ramping eventually, otherwise you’ll get crackling.

  • You must to post comments
0
0

I ran into this too, as described here: [url:2ui7wan8]http://www.fmod.org/forum/viewtopic.php?f=21&t=18770#p59277[/url:2ui7wan8].

Use Channel::setVolumeRamp(false) to fix it. I reeeally think this behavior should not be enabled on channels by default. :p

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.