Repository navigation
Allow specifying code packing order in audioop adpcm functions #76185
Description
Activity
MosesofEgypt commented
on Nov 10, 2017 MosesofEgyptmannequinMannequinAuthorMore actions--- 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- addedtype-featureA feature request or enhancementA feature request or enhancement3.7 (EOL)end of lifeend of life3.8 (EOL)end of lifeend of life
on Nov 10, 2017 MosesofEgypt commented
on Nov 18, 2017 MosesofEgyptmannequinMannequinAuthorMore actionsChanged type to behavior as this is more of a bug fix than an enhancement.
- addedtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or errorand removedtype-featureA feature request or enhancementA feature request or enhancement
on Nov 18, 2017 MosesofEgypt commented
on Dec 13, 2017 MosesofEgyptmannequinMannequinAuthorMore actionsAdded serhiy.storchaka to nosy list as the issue has been open for over a month without response(not sure if I should have done this in the first place).
Adjusting target versions, as even though the status quo leads to mishandling some input data, the fix is a feature request to make the behaviour configurable, which restricts the change to 3.7+.
Closing, as the audioop module is deprecated in 3.11 and set for removal in 3.13.
See PEP 594 – Removing dead batteries from the standard library, #91217 and #32392.
Closing, as the audioop module is deprecated in 3.11 and set for removal in 3.13.
See PEP 594 – Removing dead batteries from the standard library, #91217 and #32392.
Cc. @MosesofEgypt
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields: