Closed microbit-carlos closed 4 months ago
@srietkerk would you be able to provide C++ sample code to replicate? That will help significantly.
I can't supply what it looks like in C++ from micro:bit directly, as far as I know. However, I can point you to how the extension is calling the sample rate function. Hopefully that helps.
Setting the sample rate happens here: https://github.com/microsoft/pxt-microbit/blob/c6a9d193378b90753be0a9b3d21fd40c4f013b09/libs/audio-recording/recording.cpp#L174
Let me know if there is any other way that I can help.
Right! This has been a persistent thorn in my side for a while, but I'm happy to say that I think I've got it fixed now.
SplitterChannel objects when on the bug/stream-resampling
branch in codal-core
and codal-microbit-v2
should now handle requests for rates lower than the upstream rate, and automatically resample down to the requested rate. It should also handle requests for rates higher than the current 11k we sample the microphone at, and it will forward on the requests to the hardware to bump up the sampling frequency.
I've not currently merged these changes into master
while I test them against the existing MakeCode extension, but it was high time I actually gave an update on this issue (and the other.. err.. several others).
Thanks everyone for being patient on this one.
This should now be finally fixed with the release of v0.2.65.
From issue https://github.com/microsoft/pxt-microbit/issues/5312 as identified by @srietkerk: