Reputation: 181
I'm trying to play wav file that has a 32bit bit per sample format. When I try and generate an OpenAL databuffer and give it AL_FORMAT_STEREO_FLOAT32 as a parameter for the format type, I get an OpenAL error code 40962 which I believe means invalid enum.
Why is that happening?
Here is how I generate the buffer in OpenAL.
alBufferData(buffer, AL_FORMAT_STEREO_FLOAT32, fWavDataIn, wavHeader.subChunk2Size, wavHeader.sampleRate);
8 and 16 bits per sample works just fine with AL_FORMAT_STEREO16 and AL_FORMAT_STEREO8. But AL_FORMAT_STEREO_FLOAT32 doesn't work. Why?
Upvotes: 0
Views: 856
Reputation: 356
AL_FORMAT_STEREO_FLOAT32 is not a native feature of OpenAL. You should check for "AL EXT Float32" in the alGetString( AL_EXTENSIONS ) before using floats.
Upvotes: 1