-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Howler 2.0 - fade() function doesn't update volume property #539
Comments
Do you have a test case? I just setup a fiddle with what I thought you were describing, but it works as expected: https://jsfiddle.net/w6Lfodk0/. Also, you can't assign directly to |
I have tested the code and it didn't work as it supposed to be. var sound = new Howl({
src: 'https://dl.dropboxusercontent.com/s/1ycx2rq7szhi8sx/test2.mp3',
autoplay: true,
volume: 0,
onload: () => {
console.log(sound.volume());
sound.fade(0, 1, 5000);
sound.once('fade', function(){
console.log(sound.volume());
});
},
onplay: () => {
console.log('Sound played')
}
}); Output is
Both |
@eZethNesthrown Thanks for the test case! The latest commit on master should fix this. |
Is there any way to fade at the ending of the audio? |
Hi!
Playing around with Howler 2.0, and I notice that when doing a fade() on a Howler object, upon finishing the fade in or out, the final tweened volume of the object doesn't get updated to reflect the new volume value. So for example:
var sound = new Howl({...});
sound.fade(0, 1, 500);
//Once sound has faded in type the ff in console. Returns 0 rather than 1
sound.volume();
So if sound has a volume of 1, then I fade it out to 0, sound.volume() returns 1 rather than 0.
I also noticed that I can't just assign to the onfade (function) property once the Howl object has been initialized like so:
var sound = new Howl({...});
sound.onfade = function() { console.log('This should show in the console after fading, right?'); }
sound.fade(0, 1, 500);
Update: I went back to Howler 1.1.29, and the fade() function there updates the volume property after the tween.
The text was updated successfully, but these errors were encountered: