0
0

Hi guys,

The FMOD API don’t play any sound after upgrade to MacOSX Mountain Lion.

My init code:
[code:3enbvi2b]
FMOD_SOUND *sound1;
FMOD_Sound_SetMode(sound1, FMOD_LOOP_OFF);

FMOD_System_CreateSound(system, filename.c_str(), FMOD_SOFTWARE, 0, &sound1);
registered_sounds.insert(std::make_pair(soundName, sound1));
[/code:3enbvi2b]

The error raised on line:

[code:3enbvi2b]
FMOD_Sound_SetMode(sound1, FMOD_LOOP_OFF);
[/code:3enbvi2b]

Works fine on Snow Leopard and Lion.

Any idea? Thanks!

  • You must to post comments
0
0

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.

  • You must to post comments
0
0

Hi,

That code works before MacOSX Update, its a fact. But if my code have a mistake, is very strange. This code runs in machine of two others developers. Thanks for tip. I will test today and report results for you.

Thank you very much!

  • You must to post comments
0
0

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:
[code:3pjb3bte]
FMOD_System_CreateSound(system, filename.c_str(), FMOD_SOFTWARE | FMOD_LOOP_OFF, 0, &sound1);
[/code:3pjb3bte]

  • You must to post comments
0
0

Guys,

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!

  • You must to post comments
0
0

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.

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.