teensy-variable-playback icon indicating copy to clipboard operation
teensy-variable-playback copied to clipboard

sizeof problem in to ResamplingReader.h Line 150

Open rolfdegen opened this issue 1 year ago • 2 comments

sizeof problem in to ResamplingReader.h Line 150 "size_of(int16_t)" has not a variable ?

if (_file_size <= _header_offset * sizeof(int16_t)) { _playing = false; if (_filename) delete [] _filename; _filename = nullptr; Serial.printf("Wave file contains no samples: %s\n", filename); return false; }

rolfdegen avatar Nov 11 '24 22:11 rolfdegen

Why do you think this is a problem? sizeof can be used in two ways - sizeof variable_name or sizeof(type_name). IMHO the former is much preferable, because if you change the variable's type your code still works...

h4yn0nnym0u5e avatar Feb 05 '25 11:02 h4yn0nnym0u5e

Thanks for your answere. PlatformIO was generating a lot of messages. I changed your code a little. PlatformIO now works without messages.

rolfdegen avatar Feb 06 '25 20:02 rolfdegen