Im currently working on building a AudioEngine for my game engine and have finished everything for it. Now when I want to generate a source (AL.alGenSources) AL errors with "AL_INVALID_NAME". How can this error be caused? And how would I go about fixing it? Here are the files:
Your alGenBuffers line is incorrect, it passes AE_SOUNDS.keySet().size() that is 0 when you load the first sound; to the function argument that specify the number of buffers to generate, that should always be 1 as you are only loading 1 sound, thus creating 1 new buffer at a time,
in AudioEngine loadSound replace
AE_AL.alGenBuffers(AE_SOUNDS.keySet().size(), s.buffer, 0);
AE_AL.alGenBuffers(1, s.buffer, 0);
this is discovered by looking for the AL lib: (WW) warnings when running the code:
AL lib: (WW) Error generated on context 0x7ffbd0303420, code 0xa001, "Invalid buffer ID 0"
An error occured whilst creating sound source: NAME "boing" ; AL_INVALID_NAME (alGenSources)
AL lib: (WW) Error generated on context 0x7ffbd0303420, code 0xa001, "Invalid source ID 4294967295"
it is OK to pass an array containing null to alGenSources as it is filled with the generated source id