Binaural beats based on sleep stages to rerurn to sleep

I find binaural beats to be amazing when trying to fall asleep - I use a fireplace lullaby so the background doesn’t interfere too much with the beats. If I wake up I restart the lullaby to restart the binaural beats, which helps me to fall back asleep. Would it be possible to automatically restart the beats or the lullaby when the app detects an awake state or even light sleep state within a given sleep duration? Is this possible throught tasker or automate? Also can the binaural beats duration be controlled independently of the lullaby (or even be run without the lullaby)?