Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3875926
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T22:19:24+00:00 2026-05-19T22:19:24+00:00

I’m in the process of porting an application from Windows to Mac OS X.

  • 0

I’m in the process of porting an application from Windows to Mac OS X. It is using OpenAL for handling the sound, but I’m getting a strange behavior in the initialization of the sound engine on Mac OS X (the code is running on a MacBook Pro).

Here is the code:

int InitSoundEngine(void* data[NB_BUFFERS], size_t data_size[NB_BUFFERS])
{
    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;
    }

    return NO_ERROR;

 failed:
    /* Cleanup omitted for brievety */
    return INITIALIZATION_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.

The alGetEnumValue says:

ALuint alGetEnumValue(const ALchar *enumName);

Returns 0 if the enumeration can not be found, and sets an AL_INVALID_VALUE error condition. The presence of an enum value does not guarantee the applicability of an extension to the current context. A non-zero return indicates merely that the implementation is aware of the existence of this extension.

I think I use the function correctly. Is there a bug in the Mac OS X implementation of OpenAL ? Is 5.1 output supported via OpenAL on Mac OS X ? Is it supported via Core Audio (porting to Core Audio could be an option if this is true) ? Should I convert my audio from 5.1 to another format (3.1, stereo, …) ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T22:19:24+00:00Added an answer on May 19, 2026 at 10:19 pm

    That enum belongs to the AL_EXT_MCFORMATS extension. It is not available on Mac OS X.

    Yes, CoreAudio can handle 5.1 (or any, I think) speaker setup. I don’t know the details of how to feed it data though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a bunch of posts stored in text files formatted in yaml/textile (from
We're building an app, our first using Rails 3, and we're having to build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.