Please use Widget.
Do not worry about turnning the music off while going to sleep.
Now you can listen to music while going to sleep, and you can set a timer for the music to stop playing.
If you wanna listen next music, check Use shake and just shake.
Permissions
