Skip to content
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

AMY_Test_Pi_Pico.ino Sample Rate #183

Closed
phesterman opened this issue Aug 22, 2024 · 3 comments
Closed

AMY_Test_Pi_Pico.ino Sample Rate #183

phesterman opened this issue Aug 22, 2024 · 3 comments

Comments

@phesterman
Copy link

I just discovered that the sample rate (AMY_SAMPLE_RATE) is twice the frequency it should be, so each example sounds an octave higher. I don't know if this is the right way to handle it, but changing line 14 to "i2s.begin(AMY_SAMPLE_RATE/2);" fixes it.

Peter

@bwhitman
Copy link
Collaborator

This probably is more likely due to the code sending mono data in a stereo channel (so you're sending data twice as fast as you need to.) I haven't tested this example in a while but i wonder if we're not setting stereo/mono in the i2s setup according to what AMY_NCHANS is.

@phesterman
Copy link
Author

Yes, that makes sense. My I2S device is a Pimoroni Pico Audio Pack which is stereo-capable.

bwhitman added a commit that referenced this issue Aug 27, 2024
Fixing pi pico Arduino example (#183)
@bwhitman
Copy link
Collaborator

I've fixed this up in the example by explicitly sending two channels (even though AMY is rendering in mono for this example.) So either render AMY in stereo, or do what I do now in the AMY_Test_Pi_Pico and send mono channel twice. It looks like the arduino-pico i2s module only supports stereo.

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

No branches or pull requests

2 participants