Hello,
I'm in the process of porting one of our game to Mac OS X. We are using OpenAL in our sound engine, but we are getting a strange behavior in the initialization of the engine on Mac OS X (the code is running on a MacBook Pro).
Here is the code:
ALCdevice *device; ALCcontext *context; ALenum format; ALuint buffers[NB_BUFFERS];
device = alcOpenDevice(NULL); if (device == NULL) goto failed;
context = alcCreateContext(device, NULL); if (context == NULL) goto failed;
alcMakeContextCurrent(context);
format = alGetEnumValue("AL_FORMAT_51CHN16"); if (format == 0) goto failed;
alGenBuffers(NB_BUFFERS, buffers); if (alGetError() != AL_NO_ERROR) goto failed;
for (int i = 0; i < NB_BUFFERS; ++ i) { alBufferData(buffers[i], format, data[i], data_size[i], 48000); if (alGetError() != AL_NO_ERROR) goto failed; }
This fails when during the call to alBufferData, with an error of AL_INVALID_VALUE. While tracing the code, we discovered that alGetEnumValue("AL_FORMAT_51CHN16") is returning 0xfffffffful, and we suspect this is the root of the issue.
So my question is : does Mac OS X supports 5.1 output via OpenAL ? Or should we port our code to use Core Audio directly ? Or do we need to convert our audio to another format (3.1, stereo) ?
Thank you,
-- Sylvain Defresne Eugen Systems
|