shibatch / SSRC

A high quality audio sampling rate converter
http://shibatch.sourceforge.net/
GNU Lesser General Public License v2.1
153 stars 29 forks source link

support wave_format_extensible header #8

Open graue opened 1 year ago

graue commented 1 year ago

Many tools such as SoX and the FLAC command-line decoder now produce 24-bit wav files that use a relatively new header format, where the format tag is 0xFFFE, and the actual format tag (1 for PCM) is stored later. SSRC is rejecting these files saying only PCM is supported.

This pull request adds support for this header format based on the documentation here. I also fixed a potential buffer overflow in case someone creates a .wav file with an unusually long format chunk.

Fixes #7