Answered
1
0

I am testing out FMOD and I’m having difficulty getting occlusion working.

I can generate an occlusion ratio for the sounds within the engine already so I do not need geometry support or anything like that.

I’d just like to be able to specify how occluded each sound is, my audio files are coming from FMOD Studio so it seems I cannot use the low level API here.

I tried this:
FMOD::ChannelGroup* c = nullptr;
ERRCHECK(evt->getChannelGroup(&c));
if (c) {
ERRCHECK(c->set3DOcclusion(occludedness, occludedness));
}

But this does not work, as c is always null.

Does FMOD Studio not support audio occlusion?

Thanks

  • You must to post comments
Great Answer
1
0

Hi Sunny,

Thanks for your question.

Your code snippet looks to be okay, but there is something else to take into consideration.

GetChannelGroup does not work until the event has fully been created. To ensure this is the case, please use flushCommands after the code to create the event instance – https://www.fmod.org/documentation/#content/generated/FMOD_Studio_System_FlushCommands.html

Let me know if this has helped.

Thanks,
Richard

  • Sunny D

    Oops I posted my response as an Answer–

    Hi Richard,

    Thanks for the tip, I tried it and it did allow for a valid ChannelGroup(although pausing the thread like that is not ideal).

    Unfortunately, while it “works” and the sound volume is lowered by the occlusion, it doesn’t sound particularly realistic.

    It looks like the 2nd parameter to set3DOcclusion, reverb occlusion, is ignored– so in practice all the occlusion is doing is lowering the volume..

    i.e. if I call set3DOcclusio(1.f, 0.f), the sound is completely muted.

    I see that passing FMOD_INIT_CHANNEL_LOWPASS to fmod init is supposed to turn on some reverb, but it doesn’t appear to do anything for me.

    I guess Studio just doesn’t work with occlusion– is there a pluggin that handles this or something?

  • Richard Simms

    Hello Sunny,

    Thanks for your reply.

    Yes, that is right. If a lowpass filter has not been specified then the occlusion will only lower the volume.

    You can set the lowlevel reverb with System::setReverbProperties and control the level with ChannelControl::setReverbProperties. The low level per-channel lowpass can be added with the System::init flag: FMOD_INIT_CHANNEL_LOWPASS.

    Once these have been set then you should start hearing the 3DOcclusion working the way you expect it to.

    Thanks,
    Richard

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.