audioChannel.flush();
}
}
private void update3DSound() {
Vector3f listenerPosition = JSoundSystem.getListenerPosition();
float distance = listenerPosition.getDistance(source);
//Calculate how loud the sound is
float newVolume = (JSoundSystem.maxDistance - distance) / JSoundSystem.maxDistance;
if (newVolume <= 0) newVolume = 0;