0
0

Hi, I’m new to fmod & fmod designer, and I don’t understand this :
[code:2p2u7tub]
inline void FMOD_ERROR(std::string prefix, FMOD_RESULT result)
{
if ( result != FMOD_OK )
Ogre::LogManager::getSingleton().logMessage(prefix + std::string("FMOD Error : ") + FMOD_ErrorString(result));
}

[...]

FMOD_RESULT result;
FMOD::EventSystem_Create(& state->sound);
result = state->sound->init(64, FMOD_INIT_NORMAL, 0, FMOD_EVENT_INIT_NORMAL);
FMOD_ERROR("[INIT] ", result);
result = state->sound->setMediaPath("C:\\Documents and Settings\\dborges\\Bureau\\tsbd\\Release\\media\\sound\\");
FMOD_ERROR("[INIT] ", result);
result = state->sound->load("cutscene.fev", 0, 0);
FMOD_ERROR("[INIT] ", result);

[...]

FMOD::Event * evt = 0;

FMOD_RESULT result = fmod->getEvent(sound.c_str(), FMOD_EVENT_DEFAULT, & evt);
FMOD_ERROR(std::string("[CutScene] (") + sound + ") ", result);

// ===> HERE : result == FMOD_ERR_INVALID_PARAM <===
[...]
[/code:2p2u7tub]
Following the "simple event" example, it should work…

fmod is state->sound
sound is a std::string and it contains the correct value ("cutscene")
there is no call to fmodex api nor fmod designer api in the […]

edit : if I wasn’t clear enough : what can cause that error ?

  • You must to post comments
0
0

getGroup() does the same…

Is there any special configuration for visual studio to have fmod working properly ? In the past I couldn’t compile (eventsystem::create not found at linking), I created a new project and now it compiles…

  • You must to post comments
0
0

OK, Found it.
Please, make errors be a little bit more verbose, at least in debug. FMOD_ERR_INVALID_PARAM means that the event is not found… ( I forgot to put the project name… )

  • You must to post comments
0
0

If I may piggyback on this question, I’m seeing the same error as MsK` — getEvent() and getEventByIndex() returning FMOD_ERR_INVALID_PARAM — under different circumstances. I have a test scene in which hundreds of objects are all triggering the same sound event whenever they collide with each other. Everything works fine for several seconds, so I know the Event is at least mostly functional. And then all of a sudden I get the ambiguous INVALID_PARAM error, despite using the exact same parameters I always do. In this test app, this event is literally the only use of FMOD, so there shouldn’t be any weird behind-the-scenes interactions going on.

Here’s the relevant code:
[code:2ajtz75r] if (/object is colliding this frame/)
{
FMOD::Event *event = NULL;
FMOD_RESULT result = m_fmodEventGroup->getEventByIndex(0, FMOD_EVENT_DEFAULT, &event);
ASSERT(result == FMOD_OK); // eventually fails here
FMOD_VECTOR sndPos = {1,1,1};
result = event->set3DAttributes(&sndPos, NULL, NULL);
ASSERT(result == FMOD_OK);
result = event->start();
ASSERT(result == FMOD_OK);
}[/code:2ajtz75r]

Is there anything else that could cause getEventXXX() to return this error code? If not, I’ll have to face the terrifying prospect that something else in my app is stomping on FMOD’s memory (…ugh…), but I’d like to rule out any other possibilities first.

As a possibly-related side note, if I leave the Windows Task Manager open while my app is running, I see its memory usage increasing fairly steadily by around 100K per second. If I comment out the FMOD event-playing code, the app’s memory usage stays fairly constant. Is this the expected behavior for FMOD, given my use case? Do I need to be somehow releasing events when I’m done with them?

(boring details: Windows XP, MSVC 2008 Express, FMOD Ex 4.17.03)

Thanks,
– cort[/code]

  • You must to post comments
0
0

…and moments later, I have some new information. Since my arguments to getEventXXX() are the same every time I call it, the function returns the same Event pointer every time. If I cache the Event pointer from the first call, and just set the 3D attributes and play it after a collision, everything works and my memory usage doesn’t constantly increase. It’s probably much more efficient to boot.

So now it’s just a matter of curiosity. I understand that in my situation I don’t need to re-call getEventXXX() for every collision, but is there any reason why doing so would cause the problems I was seeing?

  • cort
  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.