sdatkinson / AudioDSPTools

A library of basic audio DSP tools
MIT License
35 stars 10 forks source link

Fixed compiler errors that result from defining DSP_SAMPLE_FLOAT #17

Open Tr3m opened 3 months ago

Tr3m commented 3 months ago

This pull request addresses the compiler errors that result from using the DSP_SAMPLE_FLOAT definition. Some of the dsp modules explicitly use the double keyword on template parameters, function argument, return types etc.

This becomes a problem when the DSP_SAMPLE_FLOAT macro is defined as some compilers complain about not being able to convert floats to doubles (which makes sense in some cases since float variables and pointers are being passed to function calls that are expecting doubles).

More specifically these errors occur for:

I'm not sure if there was a specific reason for the ImpulseResponse class to be explicitly using double precision when the other classes including the base DSP are using the macro, but this change shouldn't be too invasive since everything is defaulting to double.

I hope it's ok that I didn't open an issue first, I didn't think it was needed since the changes are pretty small...