diff --git a/examples/tests/conversion/numberformat-converter-typed/numberformat-converter.ino b/examples/tests/conversion/numberformat-converter-typed/numberformat-converter-typed.ino similarity index 100% rename from examples/tests/conversion/numberformat-converter-typed/numberformat-converter.ino rename to examples/tests/conversion/numberformat-converter-typed/numberformat-converter-typed.ino diff --git a/src/AudioTools/CoreAudio/AudioBasic/FloatAudio.h b/src/AudioTools/CoreAudio/AudioBasic/FloatAudio.h index 3e9b24935..78dc86863 100644 --- a/src/AudioTools/CoreAudio/AudioBasic/FloatAudio.h +++ b/src/AudioTools/CoreAudio/AudioBasic/FloatAudio.h @@ -4,7 +4,7 @@ namespace audio_tools { /*** - * A simple float number (in the range of -1.0 to 1.0) the supports the conversion to + * A simple float number (in the range of -1.0 to 1.0) that supports the conversion to * it's corresponding scaled int values. */ @@ -13,15 +13,19 @@ class FloatAudio { FloatAudio() = default; FloatAudio(float in) { this->value = in; } + inline operator float() { return value; } + explicit inline operator int8_t() { return value * 127; } explicit inline operator int16_t() { return value * 32767; } - inline operator float() { return value; } + explicit inline operator int24_3bytes_t() { + return value * 8388607; + } - // explicit inline operator int24_t() { - // return value * 8388607; - // } + explicit inline operator int24_4bytes_t() { + return value * 8388607; + } explicit inline operator int32_t() { return value * 2147483647; }