@Override
    public void render(RenderManager rm) {
        if (!isEnabled() || listener == null) {
            return;
        }

        Vector3f lastLocation = listener.getLocation();
        Vector3f currentLocation = camera.getLocation();
        Vector3f velocity = listener.getVelocity();

        if (!lastLocation.equals(currentLocation)) {
            velocity.set(currentLocation).subtractLocal(lastLocation);
            velocity.multLocal(1f / lastTpf);
            listener.setLocation(currentLocation);
            listener.setVelocity(velocity);
        } else if (!velocity.equals(Vector3f.ZERO)) {
            listener.setVelocity(Vector3f.ZERO);
        }

        Quaternion lastRotation = listener.getRotation();
        Quaternion currentRotation = camera.getRotation();
        if (!lastRotation.equals(currentRotation)) {
            listener.setRotation(currentRotation);
        }
    }
<code>AudioListenerState</code> updates the audio listener's position,
orientation, and velocity from a {@link Camera}.

@author Kirill Vainer
jme3-core/src/main/java/com/jme3/audio/AudioListenerState.java