private void updateFilter(Filter f) {
        int id = f.getId();
        if (id == -1) {
            // Generate OpenAL filter ID
            ib.clear().limit(1);
            efx.alGenFilters(1, ib);
            id = ib.get(0);
            f.setId(id);

            objManager.registerObject(f);
        }

        if (f instanceof LowPassFilter) {
            LowPassFilter lowPass = (LowPassFilter) f;
            efx.alFilteri(id, EFX.AL_FILTER_TYPE, EFX.AL_FILTER_LOWPASS);
            efx.alFilterf(id, EFX.AL_LOWPASS_GAIN, lowPass.getVolume());
            efx.alFilterf(id, EFX.AL_LOWPASS_GAINHF, lowPass.getHighFreqVolume());

        } else if (f instanceof HighPassFilter) {
            HighPassFilter highPass = (HighPassFilter) f;
            efx.alFilteri(id, EFX.AL_FILTER_TYPE, EFX.AL_FILTER_HIGHPASS);
            efx.alFilterf(id, EFX.AL_HIGHPASS_GAIN, highPass.getVolume());
            efx.alFilterf(id, EFX.AL_HIGHPASS_GAINLF, highPass.getLowFreqVolume());

        } else if (f instanceof BandPassFilter) {
            BandPassFilter bandPass = (BandPassFilter) f;
            efx.alFilteri(id, EFX.AL_FILTER_TYPE, EFX.AL_FILTER_BANDPASS);
            efx.alFilterf(id, EFX.AL_BANDPASS_GAIN, bandPass.getVolume());
            efx.alFilterf(id, EFX.AL_BANDPASS_GAINHF, bandPass.getHighFreqVolume());
            efx.alFilterf(id, EFX.AL_BANDPASS_GAINLF, bandPass.getLowFreqVolume());

        } else {
            throw new UnsupportedOperationException("Unsupported filter type: " + f.getClass().getName());
        }

        f.clearUpdateNeeded();
    }
Updates an OpenAL filter object based on the jME Filter properties.
Generates the AL filter ID if necessary.
@param f The Filter object.
jme3-core/src/main/java/com/jme3/audio/openal/ALAudioRenderer.java