Popping at the start of low volume sounds (API)

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:

		result = _system->init(512, FMOD_INIT_NORMAL | FMOD_INIT_VOL0_BECOMES_VIRTUAL, 0);
               /* */
               _system->createChannelGroup("effects", &_effects_channel);

Here is how I’m initializing sounds:

		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));

And here is how I’m playing sounds:

			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));
			}

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.

Thank you! That was it :slight_smile:

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.

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

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