This. I used to use Tasker and AutoInput to automatically reboot my phone every night. You can train AutoInput to tap on stuff in a sequence. I had Tasker pull up the Power Menu and AutoInput tap the Restart button. You can probably do similar with the Power Off button there
What's your source of audio? Some media players have a timer where it'll only play for a set time. Audible has it under "timer", podcast addict has it under "sleep timer".