lancaster-university / codal-microbit-v2

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

Should `StreamRecording.play()` be blocking and add a non-blocking `playAsync()`? #317

Closed microbit-carlos closed 1 year ago

microbit-carlos commented 1 year ago

MemorySource and SoundExpressions have already set up that pattern, does it make sense to do the same for StreamRecording?

The workaround in MakeCode, MicroPython and the OOB would be to just wait while StreamRecording.isPlaying() returns true, so not a big deal at all.

JohnVidler commented 1 year ago

Play renamed to playAsync(), and a new 'play' added for blocking playback, similar added for record

JohnVidler commented 1 year ago

Unfortuantely I should have tested this better before tagging... Whoops.

The async versions currently halt the processor, will investigate and issue a hotfix.

JohnVidler commented 1 year ago

This should now be fixed in v0.2.54, but pxt is having issues integrating the changes, so keeping this issue open just in case...