From: Paul Brossier Date: Thu, 8 May 2025 14:57:44 +0000 (+0200) Subject: [source_wavread] limit to 8 or 16 bits pcm files (closes gh-410) X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=a6a974532739eec4b3c29240382228b036448156;p=aubio.git [source_wavread] limit to 8 or 16 bits pcm files (closes gh-410) --- diff --git a/src/io/source_wavread.c b/src/io/source_wavread.c index 22c67191..f06831e3 100644 --- a/src/io/source_wavread.c +++ b/src/io/source_wavread.c @@ -207,13 +207,12 @@ aubio_source_wavread_t * new_aubio_source_wavread(const char_t * path, uint_t sa AUBIO_ERR("source_wavread: Failed opening %s (bitspersample can not be 0)\n", s->path); goto beach; } -#if 0 - if ( bitspersample != 16 ) { - AUBIO_ERR("source_wavread: can not process %dbit file %s\n", + + if ( bitspersample != 8 && bitspersample != 16 ) { + AUBIO_ERR("source_wavread: can not process %d-bit file %s\n", bitspersample, s->path); goto beach; } -#endif if ( byterate * 8 != sr * channels * bitspersample ) { AUBIO_ERR("source_wavread: Failed opening %s (wrong byterate)\n", s->path);