Thanks omz. I ended up using the total play time to wait.

I had thought of that, but polling for a time with short sleeps, so that the wait can be interrupted, is probably less efficient than a notification, although admittedly only slightly so. It certainly is a lot simpler.