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

Implement BaseAudioContext.state #101

Closed
orottier opened this issue Jan 22, 2022 · 2 comments
Closed

Implement BaseAudioContext.state #101

orottier opened this issue Jan 22, 2022 · 2 comments

Comments

@orottier
Copy link
Owner

https://www.w3.org/TR/webaudio/#dom-baseaudiocontext-control-thread-state-slot

Before we think about also adding onStateChange handlers ( https://www.w3.org/TR/webaudio/#dom-baseaudiocontext-onstatechange ) we need to think about the architecture for event handling (probably in a separate issue)

@orottier
Copy link
Owner Author

Once this is implemented, we can fix the panic that occurs when you add nodes to a closed context, e.g.

let context = AudioContext::new(None);
context.close();
let delay = context.create_delay(1.);

The panic occurs because we attempt to use the closed message channel to the render thread.

As per discussion in WebAudio/web-audio-api#1580, creating nodes on a closed context should not throw an exception (but will also not do anything useful)

@orottier
Copy link
Owner Author

Another panic that can be fixed is

let context = AudioContext::new(None);
let analyser = context.create_analyser();
context.close();
analyser.get_float_time_domain_data(vec![1.; 128]);

This should just return zeroes when the context is paused/closed

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

1 participant