Skip to content

Reimplement legacy AudioEngine class with AudioEngineV2 WebAudioEngine class #16898

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

docEdub
Copy link
Contributor

@docEdub docEdub commented Jul 18, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jul 18, 2025

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR replaces the legacy AudioEngine class implementation with the new AudioEngineV2 WebAudioEngine class internally, while maintaining backward compatibility through the existing public API. The change reduces the babylon.js UMD package size by 2.92 KB by eliminating duplicate audio functionality.

Key changes include:

  • Converting the legacy AudioEngine to a wrapper around the new _WebAudioEngine
  • Adding support for enabling/disabling the unmute UI in the WebAudio implementation
  • Refactoring audio destination and gain node management to be more flexible

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
audioEngine.ts Complete reimplementation as a wrapper around _WebAudioEngine while preserving the legacy API
webAudioEngine.ts Added legacy compatibility properties for audio destination and unmute UI control
webAudioMainOut.ts Enhanced gain node management with setter support and dynamic destination handling
webAudioUnmuteUI.ts Added enabled property to control UI visibility independently of engine state

@docEdub docEdub enabled auto-merge (squash) July 18, 2025 02:22
@bjsplat
Copy link
Collaborator

bjsplat commented Jul 18, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jul 18, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jul 18, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jul 18, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants