Open todo[bot] opened 3 years ago
to process audio at float or int32_t without volume is possible with the same size type.
float is a problem as it is not an integer number and there are a lot of assumption of integer type being used.
this requires to change slightly the templates. something similar to:
#include <type_traits>
if constexpr (std::is_integral_v<T>) { // constexpr only necessary on first statement
...
} else if (std::is_floating_point_v<T>) { // automatically constexpr
...
}
could be done
for float type other constexpr
are an issue:
template<typename T> constexpr int32_t unsigned_max = (std::numeric_limits<T>::max() - std::numeric_limits<T>::min());
as it as a int32_t
return type and won't match the float
type.
float type probably requires a specialization from integers....
int32_t introduce overflows and not easily replaceable with just int64_t for eg.
https://github.com/Raffaello/sdl2-sonic-drivers/blob/42a377e397cfe6e70fc779400d5664809ab983d2/sdl2-sonic-drivers/test/TestWaveGenerators.cpp#L23-L28
This issue was generated by todo based on a
TODO
comment in 42a377e397cfe6e70fc779400d5664809ab983d2 when #6 was merged. cc @Raffaello.