micropython-lib icon indicating copy to clipboard operation
micropython-lib copied to clipboard

Add chunk and aifc modules

Open mattytrentini opened this issue 3 years ago • 2 comments

Added the chunk and aifc modules from CPython with some minimal changes for MicroPython incompatibilities. Chunk is a dependency of aifc.

Note that the tests weren't ported since they use the CPython test infrastructure which is going to be challenging to run under MicroPython. A simple test for chunk was added.

Unfortunately, some of the audio files that aifc can process requires an additional library, audioop. It's implemented in C and will require a rewrite (it may be a good candidate for a native module). So, at least for now, if an attempt is made to load those particular audio files then a runtime exception will be raised ("Import Error: no module named audioop").

Successfully tested with stereo 8, 12, 16, 24, and 32 bit integer AIFF and AIFF-C files. Fails with alaw compressed data, ulaw compressed data, and float data.

mattytrentini avatar Sep 30 '21 11:09 mattytrentini

Also, I presume the Python license is compatible..?

mattytrentini avatar Sep 30 '21 11:09 mattytrentini

PEP 594 suggests that this library is to be deprecated so perhaps we should forget about this library...

mattytrentini avatar Apr 13 '22 01:04 mattytrentini