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

Online AudioContext improvements (continue playing after drop, terminate event loop) #466

Merged
merged 3 commits into from
Mar 1, 2024

Conversation

orottier
Copy link
Owner

@orottier orottier commented Feb 27, 2024

Fixes #464 #421

@orottier orottier requested a review from b-ma February 27, 2024 09:30
@b-ma
Copy link
Collaborator

b-ma commented Feb 29, 2024

Looks good to me!

Just one question, what is the use case you envision for #464 ?

@orottier
Copy link
Owner Author

Not a use case per se, but I think it is just a better representation of the spec.
A use case could be that this simply works:

fn play_background(buffer: AudioBuffer) {
    let context = AudioContext::default();
    let mut src = context.create_buffer_source();
    src.connect(&context.destination());
    src.set_loop(true);
    src.set_buffer(buffer);
    src.start();
}

Or do you think it is better to keep the previous behaviour?

@b-ma
Copy link
Collaborator

b-ma commented Feb 29, 2024

Or do you think it is better to keep the previous behaviour?

I dont know actually, no strong opinion... I don't really understand why someone would do that but I don't think this hurts neither :)

@orottier orottier merged commit 165f770 into main Mar 1, 2024
3 checks passed
@orottier orottier deleted the feature/continue-playing-after-drop branch March 1, 2024 07:40
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

Successfully merging this pull request may close these issues.

Should the AudioContext continue playing when it is dropped?
2 participants