Skip to content

Commit 318595a

Browse files
codal_port/modspeech: Allow background processing (#108)
Motivated by the simulator work, allow background processing while waiting for the speech output to be drained. This is needed to give the browser an opportunity to schedule the audio.
1 parent 1af1498 commit 318595a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/codal_port/modspeech.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ STATIC void speech_wait_output_drained(void) {
115115
#if USE_DEDICATED_AUDIO_CHANNEL
116116
while (speech_output_read >= 0) {
117117
mp_handle_pending(true);
118+
extern void microbit_hal_background_processing(void);
119+
microbit_hal_background_processing();
118120
}
119121
uint32_t atomic_state = MICROPY_BEGIN_ATOMIC_SECTION();
120122
int x = speech_output_read;

0 commit comments

Comments
 (0)