Open microbit-carlos opened 1 week ago
I can reproduce the problem. It looks like a CODAL issue and related to the recently fixed #182 which used uBit.audio.isPlaying()
to check if audio is playing or not.
It seems that upon startup, CODAL reports that audio is playing:
int main() {
uBit.init();
uBit.audio.isPlaying(); // returns true!
return 0;
}
I can work around this, but it should probably be fixed in CODAL.
It seems that upon startup, CODAL reports that audio is playing
And this is reflected in MicroPython by doing audio.is_playing()
after a reset, it returns True
.
On the audio-recording
branch, I have fixed the issue with short audio not returning, by fixing a related issue where the last part of audio may not have been sent out the pipeline if it was shorter than 64 bytes.
But, the issue with audio.is_playing()
returning True
after a reset still remains.
This in the REPL never returns until Ctrl+C is sent:
But as soon as something else larger is played (like Sound.HAPPY) it does work until the next power cycle.
Might be related to increasing
AUDIO_OUTPUT_BUFFER_SIZE
to 64, asaudio.play(audio.AudioTrack(bytearray(63)))
doesn't return either, butaudio.play(audio.AudioTrack(bytearray(64)))
does.