-
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
latencyHint on actual AudioContext #658
Comments
I think the right move would be to mimic the native AudioContext and move all that stuff into the constructor instead of an attribute. To give some backstory, i had added that feature a long time ago while it was still in flux how it was going to be handled in the specification (i believe at some point it was a settable attribute like i have it). The only small complication is that Tone.js creates the AudioContext when the page loads, so you'll have to create a new Context if you'd like to access this feature, which isn't ideal. |
That seems like a great idea to me!
I'd personally prefer to manually call the initialization and do avoid anything with side-effects. Is that feature designed around ergonomics for users? Could it be disabled somehow? |
BREAK: the latencyHint can only be set in the constructor, no longer settable after construction addresses #658
Once the Tone.setContext({
context : new Tone.Context({ latencyHint : "playback" })
}) I think for now i won't disable creating an AudioContext on startup. It's been around since the first version and would change the user experience and break a lot of people's code. |
that works great! Trying it out shortly. Thank you so much |
I think the API is actually |
whoops! yeah you're totally right Tone.setContext(new Tone.Context({ latencyHint : "playback" })) |
It would be helpful to update the docs reflecting this new usage. I had to Google around for a bit to stumble upon this closed ticket. |
The web audio api itself supports
latencyHint
as a constructor option and after a bit of digging, it seems like that's entirely separate from the Tone.jslatencyHint
option (there are no options passed into the AudioContext constructor).Is it correct to say that the
latencyHint
on the realAudioContext
is not being set? If so, how could Tone.js be instructed to use it? The Tone.js API allows for writes on the value after initialized, but I don't think the realAudioContext
does.The text was updated successfully, but these errors were encountered: