-
Notifications
You must be signed in to change notification settings - Fork 993
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
Feature Request: Adding "onerror" option to Tone.Buffers #605
Comments
Allow me to piggy-back on this request. I was about to submit a bug on this topic, noting that there's no way to handle an error loading a sample file in Tone.Sampler. Right now if you provide an invalid URL for one of the samples the Specifically, if I'm reading the code correctly:
That is, I think tweaking
instead of:
would be nearly sufficient to address this. |
Awesome. Thanks for the quick fix! |
Same here, thanks a lot! |
Hey,
I love Tone.js, but it's really frustrating that it's impossible to add an
onerror
callback when loading audio buffers (e.g. withTone.Buffers
,Tone.Sampler
). That basically means there's no way of knowing if anything went wrong during loading.Solution:
I poked through the source code and I see that the
onerror
is in fact implemented, but only on theTone.Buffer
class, but it's not included in classes that extend it. So the only thing that needs to be done is to make sure theonerror
callback is included in classes that extend/build on top ofTone.Buffer
, likeBuffers
,Sampler
etc. Should be a super quick fix, but it would make a huge difference in using Tone.js, especially for production.The text was updated successfully, but these errors were encountered: