I have to parse wav file (plain C) and validate some parameters for passing next functions. One of them is sample rate which is not so short to use bit positions for multiple test in if statement:
#define WAV_ALLOWED_SAMPLE_RATE (48000)
if(wavFile.Header.SampleRate != WAV_ALLOWED_SAMPLE_RATE) /* Sample Rate */
return WAV_HDR_CHUNK_FMT_INVALID_SAMPLE_RATE;
There is a simple way for testing multiple values that I want to pre-define at design time? Something like this:
#define WAV_ALLOWED_SAMPLE_RATE (11025 || 22050 || 44100 || 48000)
Maybe 2,3 or 4 values, depending on project needs.
Thanks in advance,