OpenAL provides calls to obtain object names.
The application requests a number of objects of a given category using alGen{Object}s. The actual values of the names returned are implementation dependent.
No guarantees on range or value are made.
... void alGenBuffers (ALsizei n, ALuint *bufferNames); void alGenSources (ALsizei n, ALuint *sourceNames);
From the other side, if you don't care about other OpenAL implementations, OpenAL soft (as for 1.17) internally returns values starting from 1, though this should be considered as implementation detail:
Unfortunately, you cannot rely on
0being reserved as invalid, as it is allowed id by specs (up to implementation to decide).According to OpenAL 1.1 specs:
From the other side, if you don't care about other OpenAL implementations, OpenAL soft (as for 1.17) internally returns values starting from
1, though this should be considered as implementation detail: