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

Question: How can I load sounds lazily? #35

Closed
wahidshafique opened this issue Oct 14, 2021 · 6 comments
Closed

Question: How can I load sounds lazily? #35

wahidshafique opened this issue Oct 14, 2021 · 6 comments
Assignees
Labels

Comments

@wahidshafique
Copy link

I want to not have to preload sounds, but rather stream them in/load as the user wishes. Is there any quick way to accomplish that?

@GeKorm
Copy link
Collaborator

GeKorm commented Nov 2, 2021

Hi, sorry I didn't get a notification. You can add sounds via redux actions as explained here https://github.com/joshwcomeau/redux-sounds#adding-more-sounds-via-actions but you may have to create an empty or dummy initial soundsData object to initialize the middleware.

@GeKorm GeKorm added the question label Nov 2, 2021
@wahidshafique
Copy link
Author

@GeKorm So I tried that using redux toolkit and it works, except onend it fails and gives an error

TypeError
Cannot read properties of undefined (reading '1002')
Howl.onend
https://1mxvw.csb.app/node_modules/redux-sounds/lib/howler_integration.js:2473:33
Howl.eval
https://1mxvw.csb.app/node_modules/howler/dist/howler.js:1886:16

reproduced here: https://codesandbox.io/s/redux-sounds-dynamic-add-bug-1mxvw?file=/src/features/counter/counterSlice.js Just load and then turn on the sound

@GeKorm
Copy link
Collaborator

GeKorm commented Dec 2, 2021

Thanks for the repro @wahidshafique! Looking into it

@GeKorm GeKorm self-assigned this Dec 2, 2021
@GeKorm GeKorm closed this as completed in 99d3e74 Dec 2, 2021
@wahidshafique
Copy link
Author

@GeKorm Hey thank you so much for the prompt fix, is it possible to roll a release for this, for some reason I cannot get it to work by just pointing to this github repo directly

@GeKorm
Copy link
Collaborator

GeKorm commented Dec 2, 2021

3.1.1 published! I was just taking my time testing it 😄 Please let me know if you encounter any more problems with this, and thanks again for reporting it.

@wahidshafique
Copy link
Author

@GeKorm You unblocked a very crucial part of our release train haha, thanks again man

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