Originally created by @GeorgeHahn on GitHub (Jun 26, 2022).
Is your feature request related to a problem? Please describe.
I sometimes forget to enable the sleep timer before falling asleep. It can be difficult to find the right place to rewind to after this happens.
Describe the solution you'd like
A setting to automatically activate the sleep timer during certain hours would help avoid these runaway listening sessions.
Describe alternatives you've considered
The play/pause history feature discussed in other issues could help solve this pain point in a different way.
Additional context
At least one other audiobook app supports this (Listen Audiobook Player on Android).
Originally created by @GeorgeHahn on GitHub (Jun 26, 2022).
### Is your feature request related to a problem? Please describe.
I sometimes forget to enable the sleep timer before falling asleep. It can be difficult to find the right place to rewind to after this happens.
### Describe the solution you'd like
A setting to automatically activate the sleep timer during certain hours would help avoid these runaway listening sessions.
### Describe alternatives you've considered
The play/pause history feature discussed in other issues could help solve this pain point in a different way.
### Additional context
At least one other audiobook app supports this (Listen Audiobook Player on Android).
Smart Audiobook player also has this feature but they handle sleep timer differently.
I'm not sure the best way to implement this. Would you want to set the time in settings to the time that you want the audio player to pause?
So you might select 22:00 which would then pause media at that time.
The other way would be setting the sleep timer at 22:00 to some length of time like 10 minutes. The problem with that implementation is we would need to add another option to set that length of time or just use a static time.
@advplyr commented on GitHub (Aug 7, 2022):
Smart Audiobook player also has this feature but they handle sleep timer differently.
I'm not sure the best way to implement this. Would you want to set the time in settings to the time that you want the audio player to pause?
So you might select 22:00 which would then pause media at that time.
The other way would be setting the sleep timer at 22:00 to some length of time like 10 minutes. The problem with that implementation is we would need to add another option to set that length of time or just use a static time.
I really like the way Smart Audiobook player implemented this, with a time range where the sleep timer is automatically enabled.
One potentially interesting option would be to automatically enable the sleep timer when Android's bedtime mode is enabled.
@GeorgeHahn commented on GitHub (Aug 7, 2022):
I really like the way Smart Audiobook player implemented this, with a time range where the sleep timer is automatically enabled.
One potentially interesting option would be to automatically enable the sleep timer when Android's bedtime mode is enabled.
Also just having option to have sleep timer enabled by default until turned off manually would be great. When I am listening to audiobooks at night and wake up, I can just press the play button on my headphones to continue listening, but it keeps playing rather than keep the previous sleep settings and stop playing after couple minutes.
@mefistos commented on GitHub (Aug 24, 2022):
Also just having option to have sleep timer enabled by default until turned off manually would be great. When I am listening to audiobooks at night and wake up, I can just press the play button on my headphones to continue listening, but it keeps playing rather than keep the previous sleep settings and stop playing after couple minutes.
@mefistos Is this how the sleep timer functions in another app you use?
Same as others have mentioned Smart Audiobook Player on Android. As @GeorgeHahn mentioned in SAP you select time range where the sleep timer is always enabled, so for example I have 22:00 till 8:00 and if I am listening in that time the sleep timer always resets and stays on so if I hit play in the middle of the night it turns off after 20 mins. After 8:00 when I am driving or working the sleep timer is off so I can listen for longer.
Or even as I said previously just having option to maybe hold the sleep timer icon for a while to keep it enabled and then hold it again to disable it would be plenty.
@mefistos commented on GitHub (Aug 24, 2022):
> @mefistos Is this how the sleep timer functions in another app you use?
Same as others have mentioned Smart Audiobook Player on Android. As @GeorgeHahn mentioned in SAP you select time range where the sleep timer is always enabled, so for example I have 22:00 till 8:00 and if I am listening in that time the sleep timer always resets and stays on so if I hit play in the middle of the night it turns off after 20 mins. After 8:00 when I am driving or working the sleep timer is off so I can listen for longer.
Or even as I said previously just having option to maybe hold the sleep timer icon for a while to keep it enabled and then hold it again to disable it would be plenty.
I understand. The sleep timer logic will have to be redone but it seems this is the consensus on what is expected.
@advplyr commented on GitHub (Aug 24, 2022):
I understand. The sleep timer logic will have to be redone but it seems this is the consensus on what is expected.
If the sleep timer is being rewritten, would it be possible to also add
option to set the timer for a custom length? I like 20mins and although
once set you can add extra time in 1 min increments it would be nice to
have the option to set it to 20 or any other custom length.
On Wed 24 Aug 2022, 00:34 advplyr, @.***> wrote:
I understand. The sleep timer logic will have to be redone but it seems
this is the consensus on what is expected.
@mefistos commented on GitHub (Aug 24, 2022):
If the sleep timer is being rewritten, would it be possible to also add
option to set the timer for a custom length? I like 20mins and although
once set you can add extra time in 1 min increments it would be nice to
have the option to set it to 20 or any other custom length.
On Wed 24 Aug 2022, 00:34 advplyr, ***@***.***> wrote:
> I understand. The sleep timer logic will have to be redone but it seems
> this is the consensus on what is expected.
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/advplyr/audiobookshelf-app/issues/260#issuecomment-1224992672>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AA4UCO3KCFFTBUNYLHHS7YTV2VNYLANCNFSM5Z4PVARQ>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
@advplyr commented on GitHub (Aug 24, 2022):
That was just recently added and will be in the next release https://github.com/advplyr/audiobookshelf-app/pull/322
That custom sleep timer value won't persist though so it would need to be entered every time it's set.
That probably won't be very useful in your use-case
@advplyr commented on GitHub (Aug 24, 2022):
That custom sleep timer value won't persist though so it would need to be entered every time it's set.
That probably won't be very useful in your use-case
@advplyr No worries, its not end of the world. I like Audiobookshelf so much that I don't mind waiting till sleep timer is rewritten.
@mefistos commented on GitHub (Aug 25, 2022):
@advplyr No worries, its not end of the world. I like Audiobookshelf so much that I don't mind waiting till sleep timer is rewritten.
Hey, I saw the dev-chat in discord and thought of sharing some screens from Smart Audiobook Player to give you a little bit of idea how it deals with sleep timer. When you short press the sleep timer icon you get to set up the schedule when it's active and when you hold the button it let's you select the specific time. You don't have to go to settings to set it up, although you can.
@mefistos commented on GitHub (Aug 30, 2022):
Hey, I saw the dev-chat in discord and thought of sharing some screens from Smart Audiobook Player to give you a little bit of idea how it deals with sleep timer. When you short press the sleep timer icon you get to set up the schedule when it's active and when you hold the button it let's you select the specific time. You don't have to go to settings to set it up, although you can.


+1 for this, Smart Audiobook Player implementation is best so far.
Set the default timer in settings to either be permanently enabled or on schedule, so it doesn't have to be set every time. The timer then resets every time the phone is moved and has an audible tone when it is about to go off, if the phone is moved between the beep and fadeout, the timer resets again.
Current timer has two issues for me:
forgetting to set it every time
Timer resets by moving only when the track starts fading out, regardless of whether the phone was last moved a minute ago or when the timer was originally set.
@Strider27 commented on GitHub (Oct 31, 2022):
+1 for this, Smart Audiobook Player implementation is best so far.
Set the default timer in settings to either be permanently enabled or on schedule, so it doesn't have to be set every time. The timer then resets every time the phone is moved and has an audible tone when it is about to go off, if the phone is moved between the beep and fadeout, the timer resets again.
Current timer has two issues for me:
1. forgetting to set it every time
2. Timer resets by moving only when the track starts fading out, regardless of whether the phone was last moved a minute ago or when the timer was originally set.
I've sent email to the SAP developer with link to ABS api with request to implement support for ABS and he said that he'll think about it. That way we'd have best of both worlds, because lest be honest SAP is hands down the best android Audiobook player out there.
Might be worth for other people sending him an email as well.
@mefistos commented on GitHub (Oct 31, 2022):
I've sent email to the SAP developer with link to ABS api with request to implement support for ABS and he said that he'll think about it. That way we'd have best of both worlds, because lest be honest SAP is hands down the best android Audiobook player out there.
Might be worth for other people sending him an email as well.
@mefistos SAP is good, but the native app is almost there. Not sure if SAP dev integrating audiobookshelf API would be a gamechanger for me at this stage, as I doubt it'll be fully integrated with series, progress sync, etc. If he does go ahead with it, it'll be most likely just the browse, stream and download locally functions.
For me personally all that's missing from the current native app is a better timer implementation and the series order field of the locally downloaded books is missing when not connected to server, making it hard to figure out which one to play next when you are away/not connected and have downloaded several books from the same series to your phone.
@Strider27 commented on GitHub (Oct 31, 2022):
@mefistos SAP is good, but the native app is almost there. Not sure if SAP dev integrating audiobookshelf API would be a gamechanger for me at this stage, as I doubt it'll be fully integrated with series, progress sync, etc. If he does go ahead with it, it'll be most likely just the browse, stream and download locally functions.
For me personally all that's missing from the current native app is a better timer implementation and the series order field of the locally downloaded books is missing when not connected to server, making it hard to figure out which one to play next when you are away/not connected and have downloaded several books from the same series to your phone.
I came here annoyed of forgetting to put a sleep timer before I sleep. I usually listen to books before sleeping and have forgotten to put a sleep timer, waking up to drained battery and a random position in the book.
As the thread said, it would be great to just auto enable sleep timer during certain hours (as set by user) for the preferred countdown time (also customisable).
I used maBook to listen AB before ABS and here is a screenshot of "Settings>Sleep timer" page in the app just for reference.
What it does is, when I press play during the set hours, it turns on the sleep timer for me.
Thank you for all the effort you have put into this so far.
@Dr-Blank commented on GitHub (Nov 16, 2022):
I came here annoyed of forgetting to put a sleep timer before I sleep. I usually listen to books before sleeping and have forgotten to put a sleep timer, waking up to drained battery and a random position in the book.
As the thread said, it would be great to just auto enable sleep timer during certain hours (as set by user) for the preferred countdown time (also customisable).
I used maBook to listen AB before ABS and here is a screenshot of "Settings>Sleep timer" page in the app just for reference.
<img src="https://user-images.githubusercontent.com/64108942/202092076-fa7bcab9-b688-43ad-a520-f0c0e3e0d10e.jpg" alt="Screenshot_2022-11-16-00-28-18-229_mindmine audiobook" width="300"/>
What it does is, when I press play during the set hours, it turns on the sleep timer for me.
Thank you for all the effort you have put into this so far.
There are really two 'features' that Smart Audiobook Player maintains and keeps it as my primary listening app:
The sleep timer resets when motion is detected. I always have the sleep timer on, set to 15 minutes. When I'm moving around, the timer is always reset to 15 mins -- but when I put the phone down and go to sleep, it will complete its countdown and slowly fade the audio out before pausing. I turned off the 'bing' indicating that the timer has completed, I just let it slowly fade out - or give the phone a shake to continue things on if I am still awake and notice the volume falling.
Currently, I believe ABS only resets that timer if motion is detected during the fade-out period.
2) A History of Playback is maintained, with play/pause, scrubbing, forward, back, etc. documented along the date/time this occurred. A tap will move the audiobook back to the selected point and resume playback from there (this move will also be documented in the history).
This feature is extremely useful if/when my playback progress is moved by an inadvertent tap, I zoned out and want to go back to the point I was at when I first started my listening session, or just want to go back in time for some reason.
Brought up in this issue: https://github.com/advplyr/audiobookshelf-app/issues/466#issuecomment-1353719349
Thank you for your continued effort into all things Audiobookshelf!
@Albuca commented on GitHub (Dec 15, 2022):
Throwing in my $0.02
There are really two 'features' that Smart Audiobook Player maintains and keeps it as my primary listening app:
1) The sleep timer resets when motion is detected. I always have the sleep timer on, set to 15 minutes. When I'm moving around, the timer is always reset to 15 mins -- but when I put the phone down and go to sleep, it will complete its countdown and slowly fade the audio out before pausing. I turned off the 'bing' indicating that the timer has completed, I just let it slowly fade out - or give the phone a shake to continue things on if I am still awake and notice the volume falling.
Currently, I believe ABS only resets that timer if motion is detected during the fade-out period.
~~2) A History of Playback is maintained, with play/pause, scrubbing, forward, back, etc. documented along the date/time this occurred. A tap will move the audiobook back to the selected point and resume playback from there (this move will also be documented in the history).
This feature is extremely useful if/when my playback progress is moved by an inadvertent tap, I zoned out and want to go back to the point I was at when I first started my listening session, or just want to go back in time for some reason.~~
Brought up in this issue: https://github.com/advplyr/audiobookshelf-app/issues/466#issuecomment-1353719349
Thank you for your continued effort into all things Audiobookshelf!
Great comments so far, and I hope this gets implemented.
Another 'feature' Smart Audiobook player has, is that it will reset the sleep timer when you pause/play. It's great when the phone is on the nightstand and you are using an bluetooth headset or similar to listen.
I also feel that the 'shake to reset' in Audiobookshelf is a bit unsensitive, maybe there could be som more options in the settings were we can tweak the sensitivity.
@linost-xx commented on GitHub (Dec 28, 2022):
Great comments so far, and I hope this gets implemented.
Another 'feature' Smart Audiobook player has, is that it will reset the sleep timer when you pause/play. It's great when the phone is on the nightstand and you are using an bluetooth headset or similar to listen.
I also feel that the 'shake to reset' in Audiobookshelf is a bit unsensitive, maybe there could be som more options in the settings were we can tweak the sensitivity.
fun play() {
if (currentPlayer.isPlaying) {
Log.d(tag, "Already playing")
return
}
currentPlayer.volume = 1F
currentPlayer.play()
sleepTimerManager.handleShake()
//Reset sleep timer on pause/play if timer is set.
if (sleepTimerManager.sleepTimerRunning) {
sleepTimerManager.setSleepTimer(sleepTimerManager.sleepTimerLength, false)
return
}
}
in PlayerNotificationService.kt to implement "reset timer on play" functionality. Obviously I had to change sleepTimerRunning and sleepTimerLength in SleepTimerManager.kt to public so I could access those variables. I'm sure there is a correct way to do this, but I'm a rebel and really needed this functionality=)
@linost-xx commented on GitHub (Jan 9, 2023):
I've added
```
fun play() {
if (currentPlayer.isPlaying) {
Log.d(tag, "Already playing")
return
}
currentPlayer.volume = 1F
currentPlayer.play()
sleepTimerManager.handleShake()
//Reset sleep timer on pause/play if timer is set.
if (sleepTimerManager.sleepTimerRunning) {
sleepTimerManager.setSleepTimer(sleepTimerManager.sleepTimerLength, false)
return
}
}
```
in _PlayerNotificationService.kt_ to implement "reset timer on play" functionality. Obviously I had to change **sleepTimerRunning** and **sleepTimerLength** in _SleepTimerManager.kt_ to public so I could access those variables. I'm sure there is a correct way to do this, but I'm a rebel and really needed this functionality=)
Man it's nice to find a thread of likeminded people 😂
I've been using SAP for quite a while now and absolutely love how the sleep timer is set up, I'd really like to see a couple of those key features implemented in ABS. Just to clarify, I use a single bluetooth earbud to listen to books before I go to sleep and it has a button on the side I can tap to pause.
The SAP features I particularly like are:
The fadeout is longer (around 30 seconds?) so there isn't a sudden drop in volume. It's far nicer drifting off to sleep if the audio gradually fades away. I'd be happy with it set in the 30 to 60 seconds range, but it would also be cool if there was an option to choose how long the fadeout is.
When I tap my earbud to pause it resets the timer, which is really handy. If I pause to talk to someone, check my phone, get a drink, take a leak etc I am back to heightened level and need to start the process of falling asleep all over again, so it'd be nice if the timer reset at the same time.
If I'm still somewhat lucid when the audio starts to fade, all I have to do is a single tap on my earbud and the volume returns to full and the timer resets. It's a small, but significant feature where tapping the pause button during the fadeout doesn't actually pause the audio, it just resets the timer.
Essentially what I do each night is set my timer for 5 minutes and listen to a book while I fall asleep. Usually I'll tap the earbud 2 or 3 times over the course of 20 minutes or so before finally falling asleep. In the morning I only have to rewind 5 minutes to make sure I didn't miss anything 😃
@InkyPi commented on GitHub (Jan 26, 2023):
Man it's nice to find a thread of likeminded people 😂
I've been using SAP for quite a while now and absolutely love how the sleep timer is set up, I'd really like to see a couple of those key features implemented in ABS. Just to clarify, I use a single bluetooth earbud to listen to books before I go to sleep and it has a button on the side I can tap to pause.
The SAP features I particularly like are:
1. The fadeout is longer (around 30 seconds?) so there isn't a sudden drop in volume. It's far nicer drifting off to sleep if the audio gradually fades away. I'd be happy with it set in the 30 to 60 seconds range, but it would also be cool if there was an option to choose how long the fadeout is.
2. When I tap my earbud to pause it resets the timer, which is really handy. If I pause to talk to someone, check my phone, get a drink, take a leak etc I am back to heightened level and need to start the process of falling asleep all over again, so it'd be nice if the timer reset at the same time.
3. If I'm still somewhat lucid when the audio starts to fade, all I have to do is a single tap on my earbud and the volume returns to full and the timer resets. It's a small, but significant feature where tapping the pause button **during** the fadeout doesn't actually pause the audio, it just resets the timer.
Essentially what I do each night is set my timer for 5 minutes and listen to a book while I fall asleep. Usually I'll tap the earbud 2 or 3 times over the course of 20 minutes or so before finally falling asleep. In the morning I only have to rewind 5 minutes to make sure I didn't miss anything 😃
I think I covered most of these for the next update. These are only for Android right now but the same logic would apply when implemented on iOS.
Here are the updates:
Shaking the device at any time while a sleep timer is running will reset it (unless you have disabled shake to reset). Shaking the device within 2 minutes of the sleep timer expiring will also reset the sleep timer and start playback.
If a sleep timer is running then pressing play will reset the sleep timer. Pressing play within 2 minutes of the sleep timing expiring will also reset the sleep timer and start playback.
If you have chosen the "End of Chapter" option then resetting the sleep timer will continue to use the end of the chapter. This means if the chapter just finished and paused, then you can shake or pause/play to reset the sleep timer to the end of the next chapter.
Shake sensitivity setting added with Very High, High, Medium, Low, Very Low. Very high means highly sensitive to movement.
Auto sleep timer. When this is enabled a sleep timer will be automatically started when playing media between the start and end time set in settings. The length of the auto sleep timer is set in settings and includes End of Chapter and using a custom time in minutes.
Currently if you cancel the sleep timer inside the audio player then it will continue to start again if within the auto sleep timer range. I think I will set this so that if you cancel it then it will remember you canceled it until you change media.
The audio now starts fading out when 60 seconds are remaining on the sleep timer (this was previously 30 seconds).
@advplyr commented on GitHub (Jan 29, 2023):
I think I covered most of these for the next update. These are only for Android right now but the same logic would apply when implemented on iOS.
Here are the updates:
1. Shaking the device at any time while a sleep timer is running will reset it (unless you have disabled shake to reset). Shaking the device within 2 minutes of the sleep timer expiring will also reset the sleep timer and start playback.
2. If a sleep timer is running then pressing play will reset the sleep timer. Pressing play within 2 minutes of the sleep timing expiring will also reset the sleep timer and start playback.
3. If you have chosen the "End of Chapter" option then resetting the sleep timer will continue to use the end of the chapter. This means if the chapter just finished and paused, then you can shake or pause/play to reset the sleep timer to the end of the next chapter.
4. Shake sensitivity setting added with `Very High`, `High`, `Medium`, `Low`, `Very Low`. Very high means highly sensitive to movement.
5. Auto sleep timer. When this is enabled a sleep timer will be automatically started when playing media between the start and end time set in settings. The length of the auto sleep timer is set in settings and includes `End of Chapter` and using a custom time in minutes.
- Currently if you cancel the sleep timer inside the audio player then it will continue to start again if within the auto sleep timer range. I think I will set this so that if you cancel it then it will remember you canceled it until you change media.
7. The audio now starts fading out when 60 seconds are remaining on the sleep timer (this was previously 30 seconds).

The idea for timer to be reset at any time was that if you are moving etc, it always resets and only starts counting down once we are sedatory. With the latest release even the very low shake sensetivity still requires you to shake the device considerably ( would be nice if there was "move to reset option") although this may not be an issue as I haven't tested it extensively, the very low sensetivity may be just about enough for it to reset during an active enough day.
Can we have an option to disable vibrate every time it resets? During an active day/workout we'll be getting ghost notification every time we move :O it'll drive people bananas 🍌
@Strider27 commented on GitHub (Jan 31, 2023):
@advplyr Thanks, You are the best!!!!
2 minor issues with timer reset.
1. The idea for timer to be reset at any time was that if you are moving etc, it always resets and only starts counting down once we are sedatory. With the latest release even the very low shake sensetivity still requires you to shake the device considerably ( would be nice if there was "move to reset option") although this may not be an issue as I haven't tested it extensively, the very low sensetivity may be just about enough for it to reset during an active enough day.
2. Can we have an option to disable vibrate every time it resets? During an active day/workout we'll be getting ghost notification every time we move :O it'll drive people bananas 🍌
One thing not mentioned that I would like to see is an option for a zero fade-out. In other words, don't fade, just pause at the end of the timer or chapter.
@RobinD42 commented on GitHub (Jan 31, 2023):
> I think I covered most of these for the next update.
Sounds like some good updates there, and obviously my comment in https://github.com/advplyr/audiobookshelf-app/issues/320#issuecomment-1409745426 should have been here.
One thing not mentioned that I would like to see is an option for a zero fade-out. In other words, don't fade, just pause at the end of the timer or chapter.
@Strider27 If you set the sensitivity to Very High then just moving the device at all should trigger the reset. If you use Very Low then you will need to give the device a good shake
@advplyr commented on GitHub (Jan 31, 2023):
@Strider27 If you set the sensitivity to Very High then just moving the device at all should trigger the reset. If you use Very Low then you will need to give the device a good shake
Thanks, I'm stupid haha, for whichever reason assumed it was the other way around.
Any way to turn off vibration every time it is reset?
@Strider27 commented on GitHub (Jan 31, 2023):
Thanks, I'm stupid haha, for whichever reason assumed it was the other way around.
Any way to turn off vibration every time it is reset?
@advplyr commented on GitHub (Jan 31, 2023):
Added in [v0.9.61-beta](https://github.com/advplyr/audiobookshelf-app/releases/tag/v0.9.61-beta) for Android.
Will leave this open until implemented on iOS
@advplyr I have the v0.9.61-beta but it still vibrates like crazy when reset, have haptic feedback off in settings. Am I missing something?
@Strider27 commented on GitHub (Jan 31, 2023):
@advplyr I have the v0.9.61-beta but it still vibrates like crazy when reset, have haptic feedback off in settings. Am I missing something?

Haptic feedback is for the user interface interaction. I will add a separate setting for controlling the sleep timer feedback.
@advplyr commented on GitHub (Jan 31, 2023):
Haptic feedback is for the user interface interaction. I will add a separate setting for controlling the sleep timer feedback.
Thanks a lot for all the effort. It's close to what I like (also a SABP user here).
An option to give a sound instead of vibration when sleep timer resets during fadeout. Would also like one when fadeout starts.
An option to reset sleep timer on every user interaction, not only play/pause.
Add an history entry when playback stop was tiggered by the sleep timer
@dedors commented on GitHub (Jun 30, 2023):
Thanks a lot for all the effort. It's close to what I like (also a SABP user here).
- An option to give a sound instead of vibration when sleep timer resets during fadeout. Would also like one when fadeout starts.
- An option to reset sleep timer on every user interaction, not only play/pause.
- Add an history entry when playback stop was tiggered by the sleep timer
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @GeorgeHahn on GitHub (Jun 26, 2022).
Is your feature request related to a problem? Please describe.
I sometimes forget to enable the sleep timer before falling asleep. It can be difficult to find the right place to rewind to after this happens.
Describe the solution you'd like
A setting to automatically activate the sleep timer during certain hours would help avoid these runaway listening sessions.
Describe alternatives you've considered
The play/pause history feature discussed in other issues could help solve this pain point in a different way.
Additional context
At least one other audiobook app supports this (Listen Audiobook Player on Android).
@advplyr commented on GitHub (Aug 7, 2022):
Smart Audiobook player also has this feature but they handle sleep timer differently.
I'm not sure the best way to implement this. Would you want to set the time in settings to the time that you want the audio player to pause?
So you might select 22:00 which would then pause media at that time.
The other way would be setting the sleep timer at 22:00 to some length of time like 10 minutes. The problem with that implementation is we would need to add another option to set that length of time or just use a static time.
@GeorgeHahn commented on GitHub (Aug 7, 2022):
I really like the way Smart Audiobook player implemented this, with a time range where the sleep timer is automatically enabled.
One potentially interesting option would be to automatically enable the sleep timer when Android's bedtime mode is enabled.
@mefistos commented on GitHub (Aug 24, 2022):
Also just having option to have sleep timer enabled by default until turned off manually would be great. When I am listening to audiobooks at night and wake up, I can just press the play button on my headphones to continue listening, but it keeps playing rather than keep the previous sleep settings and stop playing after couple minutes.
@advplyr commented on GitHub (Aug 24, 2022):
@mefistos Is this how the sleep timer functions in another app you use?
@mefistos commented on GitHub (Aug 24, 2022):
Same as others have mentioned Smart Audiobook Player on Android. As @GeorgeHahn mentioned in SAP you select time range where the sleep timer is always enabled, so for example I have 22:00 till 8:00 and if I am listening in that time the sleep timer always resets and stays on so if I hit play in the middle of the night it turns off after 20 mins. After 8:00 when I am driving or working the sleep timer is off so I can listen for longer.
Or even as I said previously just having option to maybe hold the sleep timer icon for a while to keep it enabled and then hold it again to disable it would be plenty.
@advplyr commented on GitHub (Aug 24, 2022):
I understand. The sleep timer logic will have to be redone but it seems this is the consensus on what is expected.
@mefistos commented on GitHub (Aug 24, 2022):
If the sleep timer is being rewritten, would it be possible to also add
option to set the timer for a custom length? I like 20mins and although
once set you can add extra time in 1 min increments it would be nice to
have the option to set it to 20 or any other custom length.
On Wed 24 Aug 2022, 00:34 advplyr, @.***> wrote:
@advplyr commented on GitHub (Aug 24, 2022):
That was just recently added and will be in the next release https://github.com/advplyr/audiobookshelf-app/pull/322
@advplyr commented on GitHub (Aug 24, 2022):
That custom sleep timer value won't persist though so it would need to be entered every time it's set.
That probably won't be very useful in your use-case
@mefistos commented on GitHub (Aug 25, 2022):
@advplyr No worries, its not end of the world. I like Audiobookshelf so much that I don't mind waiting till sleep timer is rewritten.
@mefistos commented on GitHub (Aug 30, 2022):
Hey, I saw the dev-chat in discord and thought of sharing some screens from Smart Audiobook Player to give you a little bit of idea how it deals with sleep timer. When you short press the sleep timer icon you get to set up the schedule when it's active and when you hold the button it let's you select the specific time. You don't have to go to settings to set it up, although you can.
@Strider27 commented on GitHub (Oct 31, 2022):
+1 for this, Smart Audiobook Player implementation is best so far.
Set the default timer in settings to either be permanently enabled or on schedule, so it doesn't have to be set every time. The timer then resets every time the phone is moved and has an audible tone when it is about to go off, if the phone is moved between the beep and fadeout, the timer resets again.
Current timer has two issues for me:
@mefistos commented on GitHub (Oct 31, 2022):
I've sent email to the SAP developer with link to ABS api with request to implement support for ABS and he said that he'll think about it. That way we'd have best of both worlds, because lest be honest SAP is hands down the best android Audiobook player out there.
Might be worth for other people sending him an email as well.
@Strider27 commented on GitHub (Oct 31, 2022):
@mefistos SAP is good, but the native app is almost there. Not sure if SAP dev integrating audiobookshelf API would be a gamechanger for me at this stage, as I doubt it'll be fully integrated with series, progress sync, etc. If he does go ahead with it, it'll be most likely just the browse, stream and download locally functions.
For me personally all that's missing from the current native app is a better timer implementation and the series order field of the locally downloaded books is missing when not connected to server, making it hard to figure out which one to play next when you are away/not connected and have downloaded several books from the same series to your phone.
@Dr-Blank commented on GitHub (Nov 16, 2022):
I came here annoyed of forgetting to put a sleep timer before I sleep. I usually listen to books before sleeping and have forgotten to put a sleep timer, waking up to drained battery and a random position in the book.
As the thread said, it would be great to just auto enable sleep timer during certain hours (as set by user) for the preferred countdown time (also customisable).
I used maBook to listen AB before ABS and here is a screenshot of "Settings>Sleep timer" page in the app just for reference.
What it does is, when I press play during the set hours, it turns on the sleep timer for me.
Thank you for all the effort you have put into this so far.
@Albuca commented on GitHub (Dec 15, 2022):
Throwing in my $0.02
There are really two 'features' that Smart Audiobook Player maintains and keeps it as my primary listening app:
Currently, I believe ABS only resets that timer if motion is detected during the fade-out period.
2) A History of Playback is maintained, with play/pause, scrubbing, forward, back, etc. documented along the date/time this occurred. A tap will move the audiobook back to the selected point and resume playback from there (this move will also be documented in the history).This feature is extremely useful if/when my playback progress is moved by an inadvertent tap, I zoned out and want to go back to the point I was at when I first started my listening session, or just want to go back in time for some reason.
Brought up in this issue: https://github.com/advplyr/audiobookshelf-app/issues/466#issuecomment-1353719349
Thank you for your continued effort into all things Audiobookshelf!
@linost-xx commented on GitHub (Dec 28, 2022):
Great comments so far, and I hope this gets implemented.
Another 'feature' Smart Audiobook player has, is that it will reset the sleep timer when you pause/play. It's great when the phone is on the nightstand and you are using an bluetooth headset or similar to listen.
I also feel that the 'shake to reset' in Audiobookshelf is a bit unsensitive, maybe there could be som more options in the settings were we can tweak the sensitivity.
@linost-xx commented on GitHub (Jan 9, 2023):
I've added
in PlayerNotificationService.kt to implement "reset timer on play" functionality. Obviously I had to change sleepTimerRunning and sleepTimerLength in SleepTimerManager.kt to public so I could access those variables. I'm sure there is a correct way to do this, but I'm a rebel and really needed this functionality=)
@InkyPi commented on GitHub (Jan 26, 2023):
Man it's nice to find a thread of likeminded people 😂
I've been using SAP for quite a while now and absolutely love how the sleep timer is set up, I'd really like to see a couple of those key features implemented in ABS. Just to clarify, I use a single bluetooth earbud to listen to books before I go to sleep and it has a button on the side I can tap to pause.
The SAP features I particularly like are:
The fadeout is longer (around 30 seconds?) so there isn't a sudden drop in volume. It's far nicer drifting off to sleep if the audio gradually fades away. I'd be happy with it set in the 30 to 60 seconds range, but it would also be cool if there was an option to choose how long the fadeout is.
When I tap my earbud to pause it resets the timer, which is really handy. If I pause to talk to someone, check my phone, get a drink, take a leak etc I am back to heightened level and need to start the process of falling asleep all over again, so it'd be nice if the timer reset at the same time.
If I'm still somewhat lucid when the audio starts to fade, all I have to do is a single tap on my earbud and the volume returns to full and the timer resets. It's a small, but significant feature where tapping the pause button during the fadeout doesn't actually pause the audio, it just resets the timer.
Essentially what I do each night is set my timer for 5 minutes and listen to a book while I fall asleep. Usually I'll tap the earbud 2 or 3 times over the course of 20 minutes or so before finally falling asleep. In the morning I only have to rewind 5 minutes to make sure I didn't miss anything 😃
@advplyr commented on GitHub (Jan 29, 2023):
I think I covered most of these for the next update. These are only for Android right now but the same logic would apply when implemented on iOS.
Here are the updates:
Very High,High,Medium,Low,Very Low. Very high means highly sensitive to movement.End of Chapterand using a custom time in minutes.@Strider27 commented on GitHub (Jan 31, 2023):
@advplyr Thanks, You are the best!!!!
2 minor issues with timer reset.
@RobinD42 commented on GitHub (Jan 31, 2023):
Sounds like some good updates there, and obviously my comment in https://github.com/advplyr/audiobookshelf-app/issues/320#issuecomment-1409745426 should have been here.
One thing not mentioned that I would like to see is an option for a zero fade-out. In other words, don't fade, just pause at the end of the timer or chapter.
@advplyr commented on GitHub (Jan 31, 2023):
@Strider27 If you set the sensitivity to Very High then just moving the device at all should trigger the reset. If you use Very Low then you will need to give the device a good shake
@Strider27 commented on GitHub (Jan 31, 2023):
Thanks, I'm stupid haha, for whichever reason assumed it was the other way around.
Any way to turn off vibration every time it is reset?
@advplyr commented on GitHub (Jan 31, 2023):
Added in v0.9.61-beta for Android.
Will leave this open until implemented on iOS
@Strider27 commented on GitHub (Jan 31, 2023):
@advplyr I have the v0.9.61-beta but it still vibrates like crazy when reset, have haptic feedback off in settings. Am I missing something?

@advplyr commented on GitHub (Jan 31, 2023):
Haptic feedback is for the user interface interaction. I will add a separate setting for controlling the sleep timer feedback.
@dedors commented on GitHub (Jun 30, 2023):
Thanks a lot for all the effort. It's close to what I like (also a SABP user here).
@marc0l92 commented on GitHub (Sep 29, 2025):
Hello, it is possible to implement the auto sleep timer available on Android, also on iOS ?