Release Notes
Fixed invalid file error.
Description
Audio loading failed on some WAV files. In particular this occurred both in 24 bit PCM WAV files, but also regular 32 bit PCM WAV files with unexpected RIFF chunks.
Solution
As we wish to support the widest possible formats of WAV files, specially common PCM subformats, we decided it would be best to adopt soundfile for WAV reading.
However, soundfile also fails whenever an unexpected RIFF chunk is encountered. Soundfile has the ability to read RAW audio files, which contain the data chunk contents and nothing else. Thus if the contents of the data chunk could be isolated it would be possible to use soundfile to convert the audio into numpy arrays. Hence we created a file-like object that wraps a single chunk as if it were a whole file, and then provide it to soundfile for reading.
Changes
1. Added pysoundfile to the dependencies.
2. Created RawAudio class that encapsulates a single RIFF chunk into a file-like format.
3. Updated the loading audio function to use soundfile and the RawAudio objects.