Skip to content

RP2040: fix 8-bit WAV playback #8436

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 30, 2023
Merged

RP2040: fix 8-bit WAV playback #8436

merged 2 commits into from
Sep 30, 2023

Conversation

PaintYourDragon
Copy link

Fix for first half of issue #8432, the "buffer too small" exception. Also a minor change to the 8- to 16-bit scaling math that previously would cause a slight DC offset.

I can see where the second half of the aforementioned issue (.playing always True w/RawSample) is happening. Don’t have a fix for that yet, but if I can sort that out, and if before this is merged, will add it to this PR.

Also subtly fixed 8- to 16-bit scaling math
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just in the ESP I2S code and it uses these helpers for conversion: https://github.com/adafruit/circuitpython/blob/main/shared-module/audiocore/__init__.c#L74

(They also don't handle the offset but are a good place to centralize this conversion.)

@tannewt
Copy link
Member

tannewt commented Sep 27, 2023

Actually, those helpers don't handle 10 bit output unfortunately. Will review this as-is.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! One question.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@PaintYourDragon PaintYourDragon merged commit ed4d4a6 into adafruit:main Sep 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants