lancaster-university / codal-microbit-v2

CODAL target for the micro:bit v2.x series of devices
MIT License
43 stars 52 forks source link

Investigate why CODAL v0.2.65 reduces the recording length in MakeCode #440

Closed microbit-carlos closed 1 month ago

microbit-carlos commented 1 month ago

Reported in:

MakeCode v6.0.28 with CODAL v0.2.63 records for 4.5 seconds:

MakeCode v6.0.28 with CODAL v0.2.65 only for ~1.2 seconds:

martinwork commented 1 month ago

@microbit-carlos The default sample rate was changed from 11000 to 44100. https://github.com/lancaster-university/codal-microbit-v2/commit/2e664e6294749c1444c002d2276674c3210ba0b8

Recording time is restored by adding a set sample rate block.

microbit-carlos commented 1 month ago

Yes, thanks Martin! It was changed from a magic number to a config option in https://github.com/lancaster-university/codal-microbit-v2/commit/d54ce9b784ef1bba22c075b281bb877abf53ea18, so set to 11K, but that also affected the mixer channel default, so maybe that's why it was pushed up to top value 44.1K.

MakeCode was depending on the default value, so the recording extension needs to set splitter channel sample rate to the default used in the extension.

microbit-carlos commented 1 month ago

PR raised in MakeCode:

microbit-carlos commented 1 month ago

Fix merged in MakeCode, so we can close this as completed.