Notes on Sound Verbs


Sound Pitch

The normal pitch of a sound is 1. To give the sound a higher pitch, use ChangeSoundPitch() and give the sound's channel a higher pitch like 1.5. To make the sound lower, use a lower number like 0.7. JK will ignore the command if you try to give the sound a pitch of zero. And when changing the pitch (especially lowering it), JK may choke, slow down, and become jerky.1

Ambience and Panning

Ambient means all-surrounding. Ambient sounds play on both speakers with equal volume. Other sounds play with varying volume on each speaker to simulate hearing a sound from a direction. So if a raildet exploded to your right, you would hear the explosion on your right speaker. This creates a panoramic sound effect known as panning.

Because PlaySoundLocal() and PlaySoundGlobal() don't use an origin, you can enter the panning for a sound. A value of -1 will make the sound play only of the left speaker, and a value of 1 will make the sound play on the right. Using a value of zero will make the sound neutral. You may use any flex from -1 to +1 for the panning you want.

Sound Distances

PlaySoundPos() and PlaySoundThing() both use a Maximum and Minimum Radius. The minrad distance is the distance from the sound's origin at which you can hear the sound at full volume. The maxrad distance is the distance at which you can hear the sound. Inside the Maximum Radius, the sound will fade out as you move away from the origin. A picture is helpful:

Unlike other distances in JK, minrad and maxrad are not measured in JKUs. Their unit is close to 1/10.5 of a JKU when the sound is played at full volume. Making the radii -1 will make JK use a default distance.

The default distance for the minrad is about 5 and the default for the maxrad is about 25.2 If you don't want to use one of the radii, use a value of 0.


1This was tested on a 1.1 Ghz. computer, but the sound was mainboard-integrated.
2These numbers are based on origin_dist * 10.5. The default distances are not exact because the conversion ratio is not exact.