Game Development Community

Sound problems in Windows

by Vern Jensen · in Torque Game Builder · 10/29/2008 (1:37 pm) · 6 replies

I have a 90% finished game that I've been developing on the Mac, and whenever I try it on Windows, I hear pops in the sound effects that are played -- it sounds like minor static popping (I think at the end of the sounds), but is loud enough to be clearly heard and definitely not something I can ship the game with.

Anyone run into this before?

Also, I shift the pitch of the sounds using alxSourcef() which works fine on the Mac build, but the sounds play at the normal pitch on Windows.

I seem to remember reading about how you should upgrade the version of OpenAL in the Torque Game Engine on the Windows build. Anyone know if this is the problem? Should I look into this? (Although I'm puzzled why this wasn't rolled into the 1.7.4 release if it's a known issue.)

Otherwise, any other ideas why my sounds would have pops?

#1
10/29/2008 (1:46 pm)
Oh, and I should add: the static is not consistent. I have these buttons on my game's title screen for instance that play a short sound when I move the mouse over them. I can move the mouse over each one individually, and rarely hear any static pops. But if I move the mouse over all of them quickly, I hear static pops quite a bit, seemingly randomly.

And also, this is using the function below to play the sounds, to make sure too many don't play at once. However, modifying the function to just call alxPlay() and return doesn't avoid the static pops.

function playSound( %datablock )
{

	// Get current millisecond running count since the game started (use GetRealTime for since system startup)
	%now = GetSimTime();
	
		// Remember that objects are just integers, so we can use them as indexes to an array
		// Also remember that an uninitialized array accessed in a mathematical expression returns 0.
	%diff = %now - $gSoundInfo[%datablock];
	
	if ( %diff > 60 ) // don't play sounds closer than 0.06 seconds apart
	{
			// Store the time that we're playing this sound
		$gSoundInfo[%datablock] = %now;
		
		%handle = alxPlay( %datablock );
	}
	
	return %handle;
}
#2
10/29/2008 (1:48 pm)
Oh, and I think it has little to do with playing lots of sounds at once. Because the game also plays a single, long sound at the game's startup which also has static pops.

The sounds are primarily in .ogg format, created with a Mac audio program from a well-known shareware company.

Edit: Actually, the button rollover sound is WAV format, and the other longer one is .ogg. Both have problems. So I don't think it's the sound format. And the WAV sound plays just fine with no popping in Windows Media Player.
#3
10/29/2008 (4:51 pm)
Also, there are some other odd differences between the folder structure and files in my game when it's built on a Mac versus built on Windows. But describing these would be difficult. However, I would be happy to send both versions to any GG employee if they're interested in checking them out. It's about 32 MB compressed, each build.
#4
10/29/2008 (5:40 pm)
Hey Vern, if you'd like to send me both versions zipped up, I'd be happy to take a look at them when I have a chance.
#5
01/07/2009 (6:30 pm)
Has the sound popping problem been solved?
i am experiencing the same thing.
Thanks,
Michael
#6
01/07/2009 (10:45 pm)
Most forms of sound popping in my experience have to do with the sound rate being different from what the sound engine expects. Like if you try to play a 44000hz audio file when the engine expects 22000hz, it's not going to sound pretty. You might try re-encoding your sound files at a different rate and see if it helps anything.