diff options
author | Chris Robinson <[email protected]> | 2023-11-15 00:52:57 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-11-15 00:52:57 -0800 |
commit | fe5b3f4fed727b6cf0e98a3454070a53ffcb2ee6 (patch) | |
tree | 784ac3793ef94cff7b4f1ab21f51f68b0e606dec /core/fmt_traits.h | |
parent | b5f5622de373ebb3dac9a1b0ce15a12d84e03b19 (diff) |
Support 32-bit int sample storage
Diffstat (limited to 'core/fmt_traits.h')
-rw-r--r-- | core/fmt_traits.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/fmt_traits.h b/core/fmt_traits.h index 1879c81b..02473014 100644 --- a/core/fmt_traits.h +++ b/core/fmt_traits.h @@ -31,6 +31,14 @@ struct FmtTypeTraits<FmtShort> { static constexpr OutT to(const Type val) noexcept { return val*OutT{1.0/32768.0}; } }; template<> +struct FmtTypeTraits<FmtInt> { + using Type = int32_t; + + template<typename OutT> + static constexpr OutT to(const Type val) noexcept + { return static_cast<OutT>(val)*OutT{1.0/2147483648.0}; } +}; +template<> struct FmtTypeTraits<FmtFloat> { using Type = float; |