Re: FMOD with Resonance Audio in Csharp

@18, I found your entire post incredibly confusing. I do not believe the way your using FMOD in that forum post is even the right way to use it, which is most likely what is causing you problems. You use several functions incorrectly, from what I can see. I.e.: system.Init. Here is its signature:

RESULT System.init(
  int maxchannels,
  INITFLAGS flags,
  IntPtr extradriverdata
);

As the FMOD manual notes:
extradriverdata Opt
Additional FMOD_OUTPUTTYPE specific initialization data.
That does not mean you throw an output type in there as a pointer, it means you specify extra driver data for the output type you want to use (which is later specified after you've initialized the system). As of FMOD 2.00.00, this only takes a filename, which is only for the non-realtime and realtime WAV output types. Other than that, this parameter is unused at this time on windows at least. Previously, when direct sound was still supported, if you wanted to use that you would've needed to pass it an HWND handle.
Second, there is no need for a channel group. A channel group is not designed to be used in the way your trying to use it. A channel group is for controlling several channels at once (i.e. adding a DSP to 5-100 different channels simultaneously, controlling master volumes for all of those channels, and so on). Usually you would want to not do this unless in special circumstances.
Third, if I understand the FMOD plugin path documentation right, the plugin isn't loading. So far as I can tell you do *no error checking* in this code. And that is most likely where your issue lies. FMOD does not throw exceptions or call abort() when an error occurs, that's what the result is for, and you should check that either on every FMOD function call (and I do mean *every*) or set an error callback after initialization.
Fourh, why are you calling fmod.getNestedPlugin()? This is entirely unnecessary. FMOD_System_LoadPlugin() places, within the out variable you indicate, a handle which you use for DSP calls. Calling fmod.getNestedPlugin() serves no purpose; stored the out handle in a clas variable if you need it across function boundaries.
Fifth, your fmod.createDSPByPlugin() function call fails because the handle you pass it isn't valid. Again, no error checking.
Sixth, you call fmod.set3DNumListeners(). This call functions as a no-op because this is already set to the value you passed in -- 1.
Seventh, again, you call fmod.set3DListenerAttributes(). Keep in mind the signature of fmod.set3DListenerAttributes():

RESULT System.set3DListenerAttributes(
  int listener,
  ref VECTOR pos,
  ref VECTOR vel,
  ref VECTOR forward,
  ref VECTOR up
);

And the parameter descriptions for that function:
listener
Listener ID in a multi-listener environment. Specify 0 if there is only 1 listener.
Range: [0, FMOD_MAX_LISTENERS]
pos Opt
Position in 3D space used for panning and attenuation. (FMOD_VECTOR)
Units: Distance units
vel Opt
Velocity in 3D space used for doppler. (FMOD_VECTOR)
Units: Distance units per second
forward Opt
Forwards orientation. (FMOD_VECTOR)
up Opt
Upwards orientation. (FMOD_VECTOR)
The forward and up vectors must be perpendicular and be of unit length (magnitude of the vector should be 1).
Vectors must be provided in the correct handedness.
Users of the Studio API should call Studio::System::setListenerAttributes instead of this function.
I could go on. But add my suggestions and FMOD should teach you where the problems actually are (though its errors can be a bit confusing).



-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : sanslash332 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : sanslash332 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : sanslash332 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : sanslash332 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector

Reply via email to