This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author MosesofEgypt
Recipients MosesofEgypt
Date 2017-11-10.23:40:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1510357207.47.0.213398074469.issue32004@psf.upfronthosting.co.za>
In-reply-to
Content
--- Issue ---
audioop.adpcm2lin and audioop.lin2adpcm currently treat the high 4 bits of each byte as the first code and the low 4 as the second code. In practice this is often the opposite.
http://www.drdobbs.com/database/algorithm-alley/184410326
https://wiki.multimedia.cx/index.php/Microsoft_IMA_ADPCM

--- Steps to reproduce ---
Run the attached script to decompress the attached wav to two different 16bit signed pcm wav files. The "GOOD" one had the nibbles of each code swapped before being decoded, while the "BAD" one didnt.

--- Suggested fix ---
I propose an additional optional boolean parameter to these functions to specify which nibble is the first code and which is the second.

NOTE: I haven't compiled my changes to test as I do not know how to set up a cpython build environment. This commit is more intended to show how to implement the fix.
https://github.com/MosesofEgypt/cpython/commit/4a5ca65833ec79857f065546ae0d90661ce26f5f
History
Date User Action Args
2017-11-10 23:40:07MosesofEgyptsetrecipients: + MosesofEgypt
2017-11-10 23:40:07MosesofEgyptsetmessageid: <1510357207.47.0.213398074469.issue32004@psf.upfronthosting.co.za>
2017-11-10 23:40:07MosesofEgyptlinkissue32004 messages
2017-11-10 23:40:07MosesofEgyptcreate