Im on OSX, trying to learn the FMOD EventSystem API, whilst taking my first feeble steps into C++ here. So any help would be appreciated.
I’ve made a simple .fev with only one event. the project builds just fine.
Then I’ve used the ‘simple_event’ as a starting point for importing my own .fev file. This is what I have so far:
void ERRCHECK(FMOD_RESULT result)
if(result != FMOD_OK)
printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result));
FMOD::EventSystem *eventsystem; FMOD::Event *event; FMOD::EventGroup *group; FMOD_RESULT result; ERRCHECK(FMOD::EventSystem_Create(&eventsystem)); ERRCHECK(result = eventsystem->init(64, FMOD_INIT_NORMAL, 0, FMOD_EVENT_INIT_NORMAL)); ERRCHECK(result = eventsystem->setMediaPath("media/")); ERRCHECK(result = eventsystem->load("test.fev", 0, 0)); ERRCHECK(result = eventsystem->getGroup("test/bell", FMOD_EVENT_DEFAULT, &group)); ERRCHECK(result = group->getEvent("thing", FMOD_EVENT_DEFAULT, &event)); ERRCHECK(result = event->start()); std::cout << "event started"; sleep(4); ERRCHECK(result = event->stop()); std::cout << "event stopped"; return 0;
I use this line to compile:
g++ -03 -o Test Test.cpp ./libfmodevent.dylib ./libfmodex.dylib -I inc/
The inc/ folder is where the .h files a stored and the .dylib files are stored in the same folder as Test.cpp
This compiles just fine. But when I run the executable i get the error message
FMOD error! (37) An invalid parameter was passed to this function.
After some debugging I found that this line is generating the error:
ERRCHECK(result = group->getEvent("thing", FMOD_EVENT_DEFAULT, &event));
I found that if I do:
the program works.
Not really sure if this really is a question related to FMOD Event API, but I’m posting here in case someone else has had similar experiences. I’m thinking this has to do with some permission settings for the files when building or compiling? The same thing happens when I try to run the ‘simple_event’ example.
Is there any reason why I have to execute the program with sudo, or are there any chages I can make in order to run this program with other privileges?
- gummipekk asked 8 years ago
- You must login to post comments