Skip to content

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

@jepler

Description

@jepler

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

  • Conversion of samples between signed & unsigned
  • Conversion of mono samples to stereo
  • Conversion between 8 and 16 bits (some ports even need other sizes, e.g., 10 bits (pico) or even non-power-of-two ranges (nrf))
  • "re-blocking" audio to fit an underlying buffer size required by the API
  • "ramping" to/from a quiescent value

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions