muted sound play with non zero gain, even if set gain to zero

Denis_BW <[email protected]>
Newsgroups gmane.comp.lib.openal
Message-ID <[email protected]>
Hi
I consistently play sound source twice. First with 1.0 gain. Next with 0.0
gain. 
And I've got a problem. Second (muted) source is plaing several milliseconds
with full gain. 
I've listened short sound noise. This make "click" effect.
Help, how to solve the problem of "clicks".

OAL Version: From Summer 2009 : Version 2.0.7.0
OS: Windows XP
Sound device: any (software, hardware)

Source code:

ALboolean PlayStaticWaveFile( const char *filename )
{
	ALuint      uiSource;
	ALuint      uiBuffer;

	alGenBuffers(1, &uiBuffer);
	if(alGetError() != AL_NO_ERROR)
		return AL_FALSE;

	if(!ALFWLoadWaveToBuffer((char*)ALFWaddMediaPath(TEST_WAVE_FILE),
uiBuffer))
	{
		ALFWprintf("Failed to load or attach %s\n", ALFWaddMediaPath(filename));
		alDeleteBuffers(1, &uiBuffer);
		return AL_FALSE;
	}
    alGenSources(1, &uiSource);
	alSourcei(uiSource, AL_BUFFER, uiBuffer);
	if (alGetError() != AL_NO_ERROR)
		return AL_FALSE;

	ALFWprintf("Source played dry. Gain 1.0f\n");
	PlayDry(uiSource);
	alSourcef(uiSource, AL_GAIN, 0.0f);
	Sleep(2000);
	// !!!
	// Here listened some sound click. Seems like first milliseconds not muted,
even AL_GAIN set to zero.
	// !!!
	ALFWprintf("Source played dry. Gain 0.0f (But listened first milliseconds
of sound sample)\n");
	PlayDry(uiSource);
	alDeleteBuffers(1, &uiBuffer);
	alDeleteSources(1, &uiSource);
	return AL_TRUE;
}

Source code, release file and test sound sample attached;

http://old.nabble.com/file/p31106503/oal_soundclicks.zip oal_soundclicks.zip 

-- 
View this message in context: http://old.nabble.com/muted-sound-play-with-non-zero-gain%2C-even-if-set-gain-to-zero-tp31106503p31106503.html
Sent from the OpenAL - User mailing list archive at Nabble.com.

_______________________________________________
Openal mailing list
[email protected]
http://opensource.creative.com/mailman/listinfo/openal
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.