I just started working with sounds for a bit and can't wrap my head around why my code isn't working at all. Doesn't matter if I load the sound from resource folders or directly from a file from my computer. It can find the file (WaveData != null). I'm doing all the al code inside the main thread so it couldn't possibly be that either.
This is my current audio code (simplified)
public void createAudio(){
buffer = alGenBuffers();
WaveData data = WaveData.create(Audio.class.getResourceAsStream("/sounds/sound2.wav"));
alBufferData(buffer, data.format, data.data, data.samplerate); // Here I'm getting an invalid enum error, AL10.alGetError()==AL10.AL_INVALID_ENUM
data.dispose();
source = alGenSources();
alSourcei(source, AL_BUFFER, buffer);
}
public void play(){
alSourcePlay(source);
}
I tried looking for an answer on what invalid enum really is, but couldn't really find anything.
If anyone could explain the problem here, that would be nice
Edit: volume to the max doesn't work btw.
Thanks in advance