-
Notifications
You must be signed in to change notification settings - Fork 1.3k
audiocore: Factor from audioio #2010
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
Conversation
When nrf pwm audio is introduced, it will be called `audiopwmio`. To enable code sharing with the existing (dac-based) `audioio`, factor the sample and mixer types to `audiocore`. INCOMPATIBLE CHANGE: Now, `Mixer`, `RawSample` and `WaveFile` must be imported from `audiocore`, not `audioio`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this! I removed unneeded headers from shared-bindings/audioio/init.c and looks good otherwise! We'll need to fix example code when we release a 5.0 beta. We should also get the mixer changes in since we're changing things.
FYI -- this is a breaking change for the CircuitPlayground Express express library since it uses audioio to call RawSample and WaveFIle. |
fwiw, I think that it would be possible to keep the classes in Meanwhile, I would also be happy to help out with some import logic in cpx to adapt to either circuitpython version, if that would be helpful. Let me know if that would be useful to you, @jerryneedell |
@jepler its not a problem for me -- I have already implemented the changes I need for the test I was doing. I just wanted to make sure it was a known issues since it is likely to cause some problems for users. |
@jepler My preference is to just move it. If you leave it in the old place there is no reason to update code. That being said, could someone post a sample import that is backwards compatible for folks? Thanks! |
Untested, but I believe you would want to write, for any or all items that you wanted from
At this point,
At this point When I'm at home, I have a CPX I can flash with 4.0.2 and current and verify that these both work in both cases. Should this be written up somewhere in the docs? or in a guide? |
I think this PR is fine and maybe release notes too. I'd tweak the except line to be |
@tannewt you mentioned getting "the mixer" fixes -- if there's an issue or pull, can you link it? I verified both workarounds,
and
with a circutplayground express using 4.0.2 and tip-of-master. |
When nrf pwm audio is introduced, it will be called
audiopwmio
. To enable code sharing with the existing (dac-based)audioio
, factor the sample and mixer types toaudiocore
.INCOMPATIBLE CHANGE: Now,
Mixer
,RawSample
andWaveFile
must be imported fromaudiocore
, notaudioio
.Testing performed: On a metro m4 express, I imported both modules and (without a speaker attached) played a RawSample out the A0 pin