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

Fix audio context not restarting automatically #249

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

TimJentzsch
Copy link
Collaborator

Objective

The script for restarting the audio context for web apps didn't work.
This resulted in the app not getting any audio.

Solution

The fix is simple: The script for restarting the audio context needs to be called before the app is loaded, I assume to ensure that the creation of the audio context is tracked correctly.

Testing

You can test it on the current prototype of the bevy_new_2d port.

Compare bevy run --no-default-features web --open with the current main and this branch.
This branch should have sound when you click the buttons.

@TimJentzsch TimJentzsch added C-Bug A bug in the program A-Run Related to the bevy run command A-Web Building or running Bevy apps targeting the browser D-Trivial Nice and easy! A great choice to get started with Bevy CLI labels Jan 29, 2025
@TimJentzsch TimJentzsch added this to the `bevy_cli` 0.1.0 milestone Jan 29, 2025
Copy link
Member

@BD103 BD103 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally and it works!

@BD103 BD103 enabled auto-merge (squash) January 29, 2025 21:14
@BD103 BD103 merged commit d3e7939 into main Jan 29, 2025
8 checks passed
@BD103 BD103 deleted the fix-audio-context-restart branch January 29, 2025 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Run Related to the bevy run command A-Web Building or running Bevy apps targeting the browser C-Bug A bug in the program D-Trivial Nice and easy! A great choice to get started with Bevy CLI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants