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

Both IDs are same #1060

Closed
hrahimi270 opened this issue Oct 15, 2018 · 1 comment
Closed

Both IDs are same #1060

hrahimi270 opened this issue Oct 15, 2018 · 1 comment
Labels
Milestone

Comments

@hrahimi270
Copy link

hrahimi270 commented Oct 15, 2018

Hello guys.
I use Howler but when I want access to IDs, it returns 2 IDs with the same number!
It's my code:

var intro = './assets/audio/bensound-creativeminds.mp3';
var backAudio = './assets/audio/bensound-betterdays.mp3';
var sound = new Howl({
 src: [intro, backAudio],
 autoplay: true,
 loop: true,
 volume: 0.1
});
var id1 = sound.play();
var id2 = sound.play();
console.log(id1, id2)

And it's the console print:
1002 1002
Both are same!
Is this a problem?
I want to fade the first sound and speed the second.

@goldfire
Copy link
Owner

Yes, this is due to this line: /~https://github.com/goldfire/howler.js/blob/master/src/howler.core.js#L665. For now, you can avoid this issue by calling those inside of onload.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants