0
0

I got strange cone events behavior in case when event system initialized with FMOD_EVENT_INIT_FAIL_ON_MAXSTREAMS flag on fmod 4.08.05. When FMOD_EVENT_INIT_FAIL_ON_MAXSTREAMS is set cones seem to be oriented in some unpredictable way.
here i’ve made a small code sample to illustrate this:

[code:lpt22vu7]
FMOD_RESULT result;
FMOD::EventSystem *event_system = 0;

define CHK(a) if (a != FMOD_OK) MessageBox(0, #a, "FMOD_ERROR", 0)

int main(int argc, char* argv[])
{
result = FMOD::EventSystem_Create(&event_system); CHK(result);
result = event_system->init(256, FMOD_INIT_NORMAL | FMOD_EVENT_INIT_FAIL_ON_MAXSTREAMS, 0); CHK(result);
FMOD::EventProject* fmod_project;
result = event_system->load("media/sounds.fev", NULL, &fmod_project); CHK(result);
FMOD::Event* ev1;
FMOD::EventGroup* eg = NULL;
result = event_system->getGroup("sounds/test", true, &eg); CHK(result);
result = eg->getEvent("test1", FMOD_EVENT_RESOURCE_STREAMS_AND_SAMPLES, &ev1); CHK(result);
result = ev1->start(); CHK(result);

while(1)
{
{ // setting listener
FMOD_VECTOR pos = {0, 0, -1};
FMOD_VECTOR vel = {0, 0, 0};
FMOD_VECTOR fwd = {0, 0, 1};
FMOD_VECTOR up = {0, 1, 0};
result = event_system->set3DListenerAttributes(0, &pos, &vel, &fwd, &up); CHK(result);
}

{ // setting event
  FMOD_VECTOR pos = {0, 0, 0};
  FMOD_VECTOR vel = {0, 0, 0};
  FMOD_VECTOR ori = {0, 0, 1};
  ev1->set3DAttributes(&pos, &vel, &ori); CHK(result);
}
result = event_system->update(); CHK(result);

}
}
[/code:lpt22vu7]

Tried it on simple project with one event with following settings:
3D Cone Inside Angle: 90
3D Cone Outside Angle: 90
3D Cone Outside Volume: -1024

So as you see, the listener placed behind event’s cone and must hear nothing. This works perfectly when FMOD_EVENT_INIT_FAIL_ON_MAXSTREAMS is not set.
When FMOD_EVENT_INIT_FAIL_ON_MAXSTREAMS is set on event system initialization (as shown above) i hear sound like cone oriented right at listener…there’re also some listener position when i dont hear anything, but they are obviously wrong of what is expected…
In both cases all the fmod routines return FMOD_OK.

any suggestions on this issue?

  • You must to post comments
0
0

event_system->init(256, FMOD_INIT_NORMAL, FMOD_EVENT_INIT_FAIL_ON_MAXSTREAMS);

The event init flags are the 3rd param.

FMOD_EVENT_INIT_FAIL_ON_MAXSTREAMS is 0x2, as is FMOD_INIT_3D_RIGHTHANDED.

Hope this helps.

  • You must to post comments
0
0

damn, missed that…
thanks!

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.