+ if (RL16(buf->str + 36) != 22) {
+ sr_err("WAV extension must be 22 bytes.");
+ return SR_ERR;
+ }
+ if (RL16(buf->str + 34) != RL16(buf->str + 38)) {
+ sr_err("Reduced valid bits per sample not supported.");
+ return SR_ERR_DATA;
+ }
+ /* Real format code is the first two bytes of the GUID. */
+ fmt_code = RL16(buf->str + 44);
+ if (fmt_code != WAVE_FORMAT_PCM && fmt_code != WAVE_FORMAT_IEEE_FLOAT) {
+ sr_err("Only PCM and floating point samples are supported.");
+ return SR_ERR_DATA;
+ }
+ if (fmt_code == WAVE_FORMAT_IEEE_FLOAT && unitsize != 4) {
+ sr_err("only 32-bit floats supported.");
+ return SR_ERR_DATA;
+ }