Don't start tracking sleep until audio out stops

I often fall asleep to audio books. Specifically I use the great Listen app which I have set up with a 10 minute timer. Every 10 minutes I need to nudge it a little to keep playing.

It would be nice if Sleep as Android didn’t start sleep tracking until there was no audio playing for x seconds. I would set x to 30.

Another way to implement this is in addition to the fixed Delay period, there could be a Delay while audio playing option again with a timeout.