FNA-XNA / FAudio

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

Extending FAudioFilterParameters to include WetDryMix #309

Closed TylerGlaiel closed 1 year ago

TylerGlaiel commented 1 year ago

as discussed via twitter DM

Added FAudioFilterParametersEXT which includes WetDryMix as a field and EXT variations of the appropriate get and set functions.

Internally, all instances of FAudioFilterParameters were swapped to FAudioFilterParametersEXT, the non-EXT versions of the get and set functions convert FAudioFilterParameters to the EXT version (with the default WetDryMix value of 1) then redirect to the EXT versions of the functions.

TylerGlaiel commented 1 year ago

Possible concerns:

FACT_internal also uses FAudioFilterParamers in there, I did not change anything in that file as it didn't seem to touch anything in FAudio_internal

Not doing any bounds checking or clamping for WetDryMix internally (do we need to?)

double check all the places where it's getting memcpy'd

flibitijibibo commented 1 year ago

FACT_internal also uses FAudioFilterParamers in there, I did not change anything in that file as it didn't seem to touch anything in FAudio_internal

Nah, FACT's supposed to use all-public features without FAudio_internal stuff (aside from stdlib maybe)

Not doing any bounds checking or clamping for WetDryMix internally (do we need to?)

Actually no; XAudio2 notoriously doesn't do bounds checking for most volume/mix-related values, you can even do negative numbers for things like volume and it's completely intentional!

double check all the places where it's getting memcpy'd

Looks like they were all found, I usually do explicit sizeof() so if we missed it somewhere that's on me...

flibitijibibo commented 1 year ago

Will write up the extension spec on Monday, thanks!