0
0

I’m trying to use my loaded FMOD::Sound, and when I call FMOD::Event::start() function it returns FMOD_ERR_INVALID_PARAM error code. But my callback is never called with FMOD::EVENT_CALLBACKTYPE_SOUNDDEF_CREATE type.

[img:o4yjqqvr]http://img73.imageshack.us/img73/222/fmodprogrammerssoundfz1.png[/img:o4yjqqvr]

And I can’t catch, how it should works – callback is setting via Event::SetEventCallback, so how can sound definition be loaded before event?

[code:o4yjqqvr]

static FMOD_RESULT F_CALLBACK OnEventGetSound(
FMOD::Event * event,
FMOD::EVENT_CALLBACKTYPE type,
void * param1,
void * param2,
void * userdata
)
{
char *name = (char *)param1;

if (type == FMOD::EVENT_CALLBACKTYPE_SOUNDDEF_CREATE)
{

    /* THIS CODE DOES NOT EXECUTE :((( */

    assert(! "here! " __FUNCTION__);
    __asm { int 3 }
    int entryindex  = *((int *)param2);         // it's a sounddef entry index on entry 
    FMOD::Sound **result_sound = (FMOD::Sound **)param2;   // and we return our Sound * through it on exit

     ............

}
return FMOD_OK;

}


    FMOD::EventGroup *g = event_system->mFmodEventGroup;
    if (!g)
        return;

    FMOD::Event *fmod_event;
    if (FMOD_RESULT res = g->getEvent(event_name, EVENT_DEFAULT, &fmod_event))
    {
        LOG_ERROR("FMOD::EventGroup::getEvent(\"%s\") failed", event_name);
        return;
    }
    assert(fmod_event);

    if (FMOD_RESULT res = fmod_event->setCallback(OnEventGetSound, NULL ))
    {
        LOG_ERROR("FMOD::Event::setCallback failed (%s)", event_name);
        return;
    }        

[/code:o4yjqqvr]

  • You must to post comments
0
0

I have found http://52.88.2.202/forum/viewtopic.php?t=5931 topic, and some things got to be cleaner…
but OnEventGetSound is still not called when I call FMOD::Event::start. Instead, start() returns FMOD_ERR_INVALID_PARAM, without attempt to call my callback.

  • You must to post comments
0
0

Does the sound definition you’re trying to play contain a programmer sound? Right click on the sound definition and choose "Add "programmer" sound".

  • You must to post comments
0
0

Yes, I have mentioned it –
[quote:1oa6oiyd][img:1oa6oiyd]http://img73.imageshack.us/img73/222/fmodprogrammerssoundfz1.png[/img:1oa6oiyd][/quote:1oa6oiyd]
But the error mystically disappeared

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.