The FMOD API don’t play any sound after upgrade to MacOSX Mountain Lion.
My init code:
FMOD_System_CreateSound(system, filename.c_str(), FMOD_SOFTWARE, 0, &sound1);
The error raised on line:
Works fine on Snow Leopard and Lion.
Any idea? Thanks!
- fronald asked 6 years ago
Saying the previous code ‘works’ is probably not accurate. The pointer ‘sound1’ being passed into SetMode will be either NULL or uninitialized memory, which would either crash or return an error. If the return code is being ignored (and the pointer is initialized to NULL) then it may appear to be working but it will not achieve the desired result of setting FMOD_LOOP_OFF for the future load of filename.c_str().
A simple fix would be remove the SetMode call entirely and change the CreateSound line to the following:
FMOD_System_CreateSound(system, filename.c_str(), FMOD_SOFTWARE | FMOD_LOOP_OFF, 0, &sound1);
That the code worked previous really not make sense, i know. Now the issue is solved. But, the code really works on Lion and i’m not crazy. I’m not arguing, I am sharing a crazy experience. This code has about 3 months with no changes. Is funny, but really worked. More two developers are laughing with me by situation. Really, is evident that code is wrong, but the mistery is: One machine with MacOSX Lion, runs code fine!
Thanks for help!
The only thing I can think of is the uninitialized pointer was hitting valid memory causing the code not to crash, nor return an error. OS differences may be at play with memory protection.
Regardless I’m glad you have gotten to the bottom of this issue.
The code snippet you have provided shows you are calling SetMode on a sound object before you have created it with CreateSound, this will return an error regardless of OS.
Can you try the examples that we ship? Do you have any problems with them? We haven’t had any issues with Mountain Lion so far.
Please login first to submit.