Skip to content
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

Sluggish fade for small fade times #884

Closed
koober opened this issue Dec 26, 2017 · 0 comments
Closed

Sluggish fade for small fade times #884

koober opened this issue Dec 26, 2017 · 0 comments

Comments

@koober
Copy link

koober commented Dec 26, 2017

Further to #621 , I find that trying to fade out in 40 milliseconds takes about a second.
Fixed (for me) by changing line 1187 in core from

              vol += (dir === 'in' ? 0.01 : -0.01);

to

              vol += (dir === 'in' ? diff/steps : -diff/steps);

so that 40 msecs is faded in 10 steps, 32 msecs can fade in 8 steps, and so on.

It doesn't seem to affect your tests for long fades.
I'm finding the fast fade useful for avoiding audio glitch when pausing a sprite.
( As an aside, can I also suggest changing line 1171;

       diff / 0.01 

to

       diff * 100 ,

and line 1176;

       steps / (4 / stepLen) 

to

       steps * stepLen * 0.25 

? )

bhaskarp-vg pushed a commit to ValueGlobal/howler.js that referenced this issue Feb 7, 2018
ringcrl pushed a commit to ringcrl/howler.js that referenced this issue Apr 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant