Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try building with newer gcc on MacOS. #20

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft
11 changes: 8 additions & 3 deletions src/webots/sound/WbSoundEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include <ode/ode.h>

#include <cassert>
#include <iostream>

static WbWorld *gWorld = NULL;
static bool gOpenAL = false;
Expand Down Expand Up @@ -92,10 +93,13 @@ static void init() {
gVolume = WbPreferences::instance()->value("Sound/volume", 80).toInt();
WbLog::toggle(stderr); // we want to disable stderr to avoid warnings in the console
try {
std::cout << "Calling alcGetString()" << std::endl;
const ALCchar *defaultDeviceName = alcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER);
if (defaultDeviceName == NULL)
if (defaultDeviceName == NULL || !strcmp(defaultDeviceName, "Null Audio Device"))
throw QObject::tr("Cannot find OpenAL default device");
std::cout << "Calling alcOpenDevice()" << std::endl;
gDefaultDevice = alcOpenDevice(defaultDeviceName);
std::cout << "Called alcOpenDevice()" << std::endl;
if (gDefaultDevice == NULL)
throw QObject::tr("Cannot initialize OpenAL default device '%1'").arg(defaultDeviceName);
gContext = alcCreateContext(gDefaultDevice, NULL);
Expand All @@ -106,8 +110,9 @@ static void init() {
gDevice = QString(defaultDeviceName);
} catch (const QString &e) {
WbLog::toggle(stderr);
if (WbSysInfo::environmentVariable("CI").isEmpty())
WbLog::warning(QObject::tr("Cannot initialize the sound engine: %1").arg(e));
WbLog::warning(QObject::tr("Cannot initialize the sound engine: %1").arg(e));
std::cout << QObject::tr("Cannot initialize the sound engine: %1").arg(e).toUtf8().constData() << std::endl;

return;
}
WbLog::toggle(stderr);
Expand Down
Loading