FNA-XNA / FAudio

FAudio - Accuracy-focused XAudio reimplementation for open platforms
https://fna-xna.github.io/
Other
545 stars 73 forks source link

Implementing Resonance Audio #113

Closed boberfly closed 5 years ago

boberfly commented 5 years ago

Hey all,

I was thinking of implementing FAudio into a game engine directly, and bypassing the XAudio COM interface. One of my other plans was to also implement https://github.com/resonance-audio/resonance-audio as an 'FAPO', the Unity integration looks like a decent reference to work from.

The official docs of XAudio2 suggest to subclass XAPOBase, but FAPO looks like a C-API, and looking at the implementations do I make one like this? https://github.com/FNA-XNA/FAudio/blob/master/src/FAPOFX_masteringlimiter.c With my hypothetical FAPOResonanceAudioRenderer I would have FAPOBase at the start of the struct with that funky #INITPARAMS macros to fill it up?

Cheers!

flibitijibibo commented 5 years ago

You’ve pretty much got it right; instead of an inherited class you just put a FAPOBase at the top of your structure, to (very roughly) mimic the layout of a C++ class. It’s not nearly as direct as the rest of the FAudio API but it was the only way to get a C-only approximation of what XAPO was doing.

flibitijibibo commented 5 years ago

Closing due to old age, but I think I answered this...