-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sleep Timer Improvements: fade out 5s before pausing playback #1629
Conversation
@@ -0,0 +1,47 @@ | |||
import Foundation | |||
|
|||
class FadeOutManager { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like this name at all, but couldn't think of something better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tricky one maybe:VolumeControl
or FaderMixer
…r/fade-out-when-finishing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working great! Tested with the DefaultPlayer and EffectsPlayer and the fade out is pretty smooth.
When a Sleep Timer is 5s from finishing, the audio has faded out.
I did some research and found that for human hearing a logarithmic fade-out (instead of an exponential one) sounds more natural, so I went ahead and implemented it.
To test
Go to
SleepTimerViewController.swift
and changefiveMinutesTapped
to10.seconds
, so it's easier to test.DefaultPlayer
PlaybackManager
and comment lines1155
to1157
(to ensureEffectsPlayer
is not used)EffectsPlayer
PlaybackManager
Checklist
CHANGELOG.md
if necessary.