adafruit / circuitpython

CircuitPython - a Python implementation for teaching coding with microcontrollers
https://circuitpython.org
Other
4.09k stars 1.21k forks source link

audio: Refactor and improve the port-independent code #4184

Open jepler opened 3 years ago

jepler commented 3 years ago

Some items that have come up repeatedly but have been addressed separately each time:

We should more closely identify what we would like to do, find APIs to place (probably in common-hal/audiocore) that facilitates it, and then re-write each implementation to use the new APIs. This could also include modifying the existing APIs, e.g., how audiosamples work, to better fit our needs. This overall bug will probably require multiple PRs, so creating additional "sub-issues" is appropriate, especially when the specific sub-issue would be targeted to a release-based milestone.

tannewt commented 3 years ago

Some of this shared code will probably need to be platform aware too or at least weak. For example, the RP2040 has an interpolator that may be able to accelerate some of the conversion. Cortex-M4s also have some basic SIMD instructions that can be used to do multiple instructions at once. (I'm not sure if the compiler will automatically use them.)