Fix audiocore.flush to be async #60
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently, audiocore.flush() (stop playback as soon as all MP3 frames still in the buffer have been decoded) is blocking. Depending on the mp3 file this can cause issues with the watchdog, as (especially when the song ends in silence) the last MP3_BUFFER_SIZE (=4k) bytes can take significant time to decode.
audiocore.flush() should be made async on the python side so that it can awaited. On the C side, this should be done using an interrupt to notify the python side (see audiocore.async_put)