steam-audio icon indicating copy to clipboard operation
steam-audio copied to clipboard

SteamAudio/Phonon with Low Level Fmod Dsp Effect

Open CDanSantana opened this issue 2 years ago • 3 comments

Hi!

I'm sorry if this isn't the correct place to post, but...

Is there any official documentation on how to use the SteamAudio Fmod plugin (phonon_fmod) with the low level Fmod Api?

Right now, I'm trying the following:

  • Load the Fmod system;
  • Create a channel group;
  • Load a sound file;
  • Set the loaded sound to 3d mode and to loop;
  • Create a channel on the channel group;
  • Play the loaded sound on the created channel;
  • Load the phonon plugin (phonon_fmod.dll);
  • Create a Steam Audio Spatializer dsp effect from the loaded plugin;
  • Set the first parameter (source) of the created dsp with a instance of FMOD_DSP_PARAMETER_3DATTRIBUTES;
  • Attach the created dsp to the channel;
  • At this point the channel becomes mute.

I used to follow the previous steps with the 2.0 version of the plugin. But after updating to the 4.1.1, the fmod channel becomes mute when I insert the dsp on the channel.

So... Is there any official documentation on how to use the SteamAudio Fmod plugin (phonon_fmod) with the low level Fmod Api?

CDanSantana avatar Nov 11 '22 23:11 CDanSantana

The API documentation for the Steam Audio FMOD Studio plugin is available here: https://valvesoftware.github.io/steam-audio/doc/fmod/api-reference.html.

You need to make sure you call iplFMODInitialize, iplFMODSetHRTF, and iplFMODSetSimulationSettings. This ensures that the plugin is able to use resources created and initialized on the main thread. Let us know if this helps resolve the issue.

lakulish avatar Nov 14 '22 19:11 lakulish

Hi @lakulish! Thanks for commenting!

Sorry, but it seems like some functions are not present in the .dll files... I'm using the binaries available on the release page... Found the function, the dll was corrupted.

I wasn't able to identify where I should make the call to the initialization functions...

I'm trying to use the plugin from the Fmod Low Level api... I am currently not using the Fmod Studio...

Is there any examples available? Or I'm not supposed to be trying to use the plugin this way?

One more time, thanks for your help!

CDanSantana avatar Nov 14 '22 20:11 CDanSantana

Hi again!

I managed to get it working... Almost...

I followed your suggestion to call the initialization function before using the plugin...

As I had no way to call the function from within my code (the Fmod who is initializing the plugin), I edited the source code, and tried to "force" a call to the initialization function. Apparently, it worked... I can already hear the effect being applied, but I must have done something wrong, because the sound is completely crackeling... I edited the "spatialize_effect.cpp" with the following...

_if (!gContext && isRunningInEditor())
{
    initContextAndDefaultHRTF(audioSettings);
}else{
    initContextAndDefaultHRTF(audioSettings);
}_

Thanks for the suggestion... I'll keep trying...

CDanSantana avatar Nov 15 '22 04:11 CDanSantana

This issue has been automatically marked stale, and will automatically be closed in 30 days if no activity occurs.

github-actions[bot] avatar Jul 07 '24 16:07 github-actions[bot]