@Override
    public void deleteAudioData(AudioData audioData) {
        synchronized (threadLock) {
            if (audioDisabled) {
                return;
            }

            if (audioData instanceof AudioBuffer) {
                AudioBuffer ab = (AudioBuffer) audioData;
                int id = ab.getId();
                if (id != -1) {
                    ib.put(0, id);
                    ib.clear().limit(1);
                    al.alDeleteBuffers(1, ib);
                    ab.resetObject(); // Mark as deleted on JME side
                }
            } else if (audioData instanceof AudioStream) {
                AudioStream as = (AudioStream) audioData;
                int[] ids = as.getIds();
                if (ids != null) {
                    ib.clear();
                    ib.put(ids).flip();
                    al.alDeleteBuffers(ids.length, ib);
                    as.resetObject(); // Mark as deleted on JME side
                }
            }
        }
    }
Deletes the OpenAL objects associated with the AudioData.
@param audioData The AudioData to delete.
jme3-core/src/main/java/com/jme3/audio/openal/ALAudioRenderer.java