0
0

Hi Everyone!

ok I’ve scoured the forums for any related posts about this problem, but if this is a common question I apologize in advance for repetition

I’ve been going through the examples that came with FMOD EX and FMOD Designer API in XCODE on my Mac G4 powerbook.

I got most of the examples to work except one: the example called "play simple event". This example was to load and play an FMOD event and is located under the FMOD designer API. Everytime I run my program i get the following error:

"FMOD error! (37)"
this happens when I make a call to the function getGroup().

This is a long shot; but I noticed that in the FMOD designer documentation and in FMOD Ex they mentioned that you require both the .fev file AND the .fsb file. This example folder did not come with a .FSB file, and it was not referenced at all in the code. Do you need to load a .FSB file?

The FMOD designer grpup I am trying to load is called "car" and has a whole bunch of sound files
(.ogg files)

I’m pasting my code below if you want to take a look.

Any help or a nod in the right direction will be extremaly appreciated!!

thanks

/*===============================================================================================
SimpleEvent Example
Copyright (c), Firelight Technologies Pty, Ltd 2004-2007.

Demonstrates basic usage of FMOD’s data-driven event library (fmod_event.dll)
===============================================================================================*/

include "../../../api/inc/fmod_event.hpp"

include "../../../api/inc/fmod.hpp"

include "../../../examples/common/wincompat.h"

include <stdio.h>

include <stdlib.h>

const float UPDATE_INTERVAL = 100.0f;

void ERRCHECK(FMOD_RESULT result)
{
if (result != FMOD_OK)
{
printf("FMOD error! (%d)\n", result);
exit(-1);
}
}

int main(int argc, char *argv[])
{
FMOD::EventSystem *eventsystem;
FMOD::EventGroup *eventgroup;
FMOD::Event *car;
FMOD::EventParameter *rpm;
FMOD::EventParameter *load;
FMOD_RESULT result;
int key;
float val, rangemin, rangemax, updatespeed;

printf(&quot;======================================================================\n&quot;);
printf(&quot;Simple Event Example.  Copyright (c) Firelight Technologies 2004-2007.\n&quot;);
printf(&quot;==============================-------=================================\n&quot;);
printf(&quot;This example plays an event created with the FMOD Designer sound \n&quot;);
printf(&quot;designer tool.  It simply plays an event, retrieves the parameters\n&quot;);
printf(&quot;and allows the user to adjust them.\n&quot;);
printf(&quot;======================================================================\n\n&quot;);

result = FMOD::EventSystem_Create(&amp;eventsystem);
ERRCHECK(result);
printf(&quot;ok!&quot;); 

result = eventsystem-&gt;init(64, FMOD_INIT_NORMAL, 0, FMOD_EVENT_INIT_NORMAL);
ERRCHECK(result);
printf(&quot;ok!&quot;); 


result = eventsystem-&gt;setMediaPath(&quot;../../../media&quot;);
ERRCHECK(result);
printf(&quot; media ok!&quot;);


result = eventsystem-&gt;load(&quot;examples.fev&quot;, 0, 0);
ERRCHECK(result);
printf(&quot;examples ok!&quot;); 

/*THIS IS WHERE I GET AN ERROR*/
result = eventsystem-&gt;getGroup(&quot;car&quot;, FMOD_EVENT_DEFAULT, &amp;eventgroup);
ERRCHECK(result);
printf(&quot;car group ok!&quot;); 

result = eventgroup-&gt;getEvent(&quot;car&quot;, FMOD_EVENT_DEFAULT, &amp;car);
ERRCHECK(result);


result = car-&gt;getParameter(&quot;load&quot;, &amp;load);
ERRCHECK(result);
result = load-&gt;getRange(&amp;rangemin, &amp;rangemax);
ERRCHECK(result);
result = load-&gt;setValue(rangemax);
ERRCHECK(result);

result = car-&gt;getParameterByIndex(0, &amp;rpm);
ERRCHECK(result);
result = rpm-&gt;getRange(&amp;rangemin, &amp;rangemax);
ERRCHECK(result);
result = rpm-&gt;setValue(1000.0f);
ERRCHECK(result);

result = car-&gt;start();
ERRCHECK(result);

printf(&quot;======================================================================\n&quot;);
printf(&quot;Press '&lt;'   to decrease RPM\n&quot;);
printf(&quot;Press '&gt;'   to increase RPM\n&quot;);
printf(&quot;Press ESC   to quit\n&quot;);
printf(&quot;======================================================================\n&quot;);

updatespeed = (rangemax - rangemin) / UPDATE_INTERVAL;
rpm-&gt;getValue(&amp;val);
key         = 0;
do
{
    if (kbhit())
    {
        key = getch();

        if (key == '&lt;')
        {
            val -= updatespeed;
            if (val &lt; rangemin)
            {
                val = rangemin;
            }

            result = rpm-&gt;setValue(val);
            ERRCHECK(result);
        }
        else if (key == '&gt;')
        {
            val += updatespeed;
            if (val &gt; rangemax)
            {
                val = rangemax;
            }

            result = rpm-&gt;setValue(val);
            ERRCHECK(result);
        }

    }

    eventsystem-&gt;update();
    Sleep(15);

    printf(&quot;Car RPM = %.4f       \r&quot;, val);
    fflush(stdout);

} while (key != 27);

result = eventgroup-&gt;freeEventData();
ERRCHECK(result);
result = eventsystem-&gt;release();
ERRCHECK(result);

return 0;

}

  • You must to post comments
0
0

The FSB files are generated by running a script in the same directory as the simple event example.

Simply navigate to the simple event example directory in a terminal window and then type:

./build_media_files.sh

You will notice a text file in this directory also that gives the same instructions.

After the script has run the FSB files will be put in the media directory referenced by the code with setMediaPath, the .fev is also in that directory.

  • You must to post comments
0
0

Ok here’s what I got;

I Ran ./build_media_files under terminal and got two .fsb files: car.fsb, other.fsb and 11 .ogg files, all under the media directory.

When I ran the simple_event program I get the same error. It recognizes the .fev file (examples.fev) but when it calls the getGroup() function I get an error.

Here’s the function call:
result = eventsystem->getGroup("car", FMOD_EVENT_DEFAULT, &eventgroup);
ERRCHECK(result);
printf("car group ok!"); //this is for debugging purposes

when I run it I get the following error:
FMOD error! (37)

is the group "car" passed in correctly? I’m assuming it’s looking for the car.fsb file, correct? I also noticed there was a directory included in the tutorial called "car" under the media directory too.

thanks again for any help, and any boot in the right direction : )

  • You must to post comments
0
0

You should be calling getGroup with the full path to the car group in the project. The full path, if you are using the files that come with the API is "examples/examples/car" so this is the examples project, the examples group, then the car group. You then call getEvent on that group you have received as per your current code.

If you look at the code in the simple event example you can see that the getGroup call looks like this:

[code:38tzvk5w]
result = eventsystem->getGroup("examples/examples/car", FMOD_EVENT_DEFAULT, &eventgroup);
[/code:38tzvk5w]

  • You must to post comments
0
0

OMG! thanks Matthew — I was confusing the directory paths with the project paths. I used examples/examples/car and it worked.

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.