microbit-foundation / micropython-microbit-v2

Temporary home for MicroPython for micro:bit v2 as we stablise it before pushing upstream
MIT License
42 stars 23 forks source link

codal_port/modspeech: Allow background processing for the sake of the browser/simulator #108

Closed microbit-matt-hillsdon closed 2 years ago

microbit-matt-hillsdon commented 2 years ago

@dpgeorge for speech to work in audio this while needs to relinquish control to the browser.

Raising as a draft PR just to clearly indicate the point that needs to yield but no expectation that we'd merge it like this.

Is there a suitable hook to call? microbit_hal_background_processing might be doing too much?

dpgeorge commented 2 years ago

Is there a suitable hook to call? microbit_hal_background_processing might be doing too much?

I think microbit_hal_background_processing() is the right thing to call here. If adding that doesn't affect the existing speech behaviour on actual hardware, I'd say add it.

microbit-matt-hillsdon commented 2 years ago

Is there a suitable hook to call? microbit_hal_background_processing might be doing too much?

I think microbit_hal_background_processing() is the right thing to call here. If adding that doesn't affect the existing speech behaviour on actual hardware, I'd say add it.

Thanks. I've updated this PR to call microbit_hal_background_processing. There's no change on V2 that I can see (play time is consistent) and it works fine in the sim.