ddiakopoulos / libnyquist

:microphone: Cross platform C++11 library for decoding audio (mp3, wav, ogg, opus, flac, etc)
BSD 2-Clause "Simplified" License
534 stars 64 forks source link

IMA ADPCM Stereo wav length half reduced #56

Open q2p0 opened 2 years ago

q2p0 commented 2 years ago

Hi.

I'm using libnyquist. And found that while decoding wavs of type IMA ADPCM of two channels the length of the decoded file is reduced to half. If I add

        if (wavHeader.channel_count == 2)
          totalSamples *= 2;

On WavDecoder.cpp line 309 the problem seems to be fixed.

But I'm not sure if it is the right solution.

Thanks.