drain

open suspend override fun drain()

CoreAudio has no drain of its own. Once the callback stops supplying samples the device plays what it already holds and then silence, so waiting out the buffer already handed over is exactly the drain the engine needs before declaring the end of the media.