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

Looped sounds can't be addressed after completing their first loop #26

Closed
rovenko opened this issue Aug 26, 2020 · 6 comments
Closed

Looped sounds can't be addressed after completing their first loop #26

rovenko opened this issue Aug 26, 2020 · 6 comments
Assignees

Comments

@rovenko
Copy link

rovenko commented Aug 26, 2020

When using a looped sound, it's only possible to address the sound (i.e. fade / stop) only when the very first iteration of the loop is being played back.
As soon as the sound goes into the second iteration of the loop, the same control actions stop working.

@rovenko
Copy link
Author

rovenko commented Aug 27, 2020

Howler's onend Function fires when the sound finishes playing (if it is looping, it'll fire at the end of each loop). The first parameter is the ID of the sound.
redux-sounds, uses "onend" handler that calls this.removeId(id) therefore removing it from the list and making it unavailable.
Given that there's "onstop" - is removeId(id) necessary for "onend"?

@GeKorm GeKorm self-assigned this Jan 21, 2021
@ludgerey
Copy link
Contributor

Any feasible workarounds for this?

Being unable to stop sounds makes this library not applicable for background music.

@rovenko
Copy link
Author

rovenko commented Feb 27, 2021

Any feasible workarounds for this?

Being unable to stop sounds makes this library not applicable for background music.

I've applied a git patch to to fix it in my local repo.

Simply comment out _this2.removeId(id); and this.removeId(id); in relevant spots in howler_integration.js and it seems to do the trick.

@ludgerey
Copy link
Contributor

@rovenko Thanks for the heads up!

I got it fixed and added a pull request that supports looped sounds.

@GeKorm
Copy link
Collaborator

GeKorm commented Mar 15, 2021

Merged #28. I'll release the fix in a few days, thank you both for the bug report and PR, I really appreciate the help!

@GeKorm
Copy link
Collaborator

GeKorm commented Mar 23, 2021

3.3.0 Published to npm!

@GeKorm GeKorm closed this as completed Mar 23, 2021
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

3 participants