private void enumerateAvailableChannels() {
        // Find maximum # of sources supported by this implementation
        ArrayList<Integer> channelList = new ArrayList<>();
        for (int i = 0; i < MAX_NUM_CHANNELS; i++) {
            int sourceId = al.alGenSources();
            if (al.alGetError() != 0) {
                break;
            } else {
                channelList.add(sourceId);
            }
        }

        channels = new int[channelList.size()];
        for (int i = 0; i < channels.length; i++) {
            channels[i] = channelList.get(i);
        }

        ib = BufferUtils.createIntBuffer(channels.length);
        channelSources = new AudioSource[channels.length];
    }
Generates OpenAL sources to determine the maximum number supported.
jme3-core/src/main/java/com/jme3/audio/openal/ALAudioRenderer.java