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

Lazy-load audio engine #2628

Open
Kryptos-FR opened this issue Feb 3, 2025 · 2 comments
Open

Lazy-load audio engine #2628

Kryptos-FR opened this issue Feb 3, 2025 · 2 comments
Labels
area-Audio enhancement New feature or request

Comments

@Kryptos-FR
Copy link
Member

Is your feature request related to a problem? Please describe.
The audio providers/components/etc. are always initialized in a game, even if all scenes don't have any audio component/listener.

Describe the solution you'd like
Have the audio system initialize on-demand (when it is first needed).

Describe alternatives you've considered
This behavior could be driven by a configuration option, where audio is

  • opt-out: in which case any attempt to initialize it would throw
  • lazy-load: initialized on first use
  • pre-load (current behavior): initialized at the start

Additional context
While rare, some games might not need any audio. Not initializing that part of the engine might save some memory and improve performance.

Another use case is when trying to run a game from WSL where audio is not supported by default. Granted, it is niche but very useful for developers to quickly test whether a game works correctly on Linux without requiring dual-boot or another machine.

@VaclavElias
Copy link
Contributor

Also, just when learning game phycics and gaming logic and concepts, one doesn't need necessarily audio.

@Doprez
Copy link
Contributor

Doprez commented Feb 4, 2025

Could an EntityProcessor be the solution for this?

Have a component for audio and when its added use the OnSystemAdd from the processor to initialize the audio provider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Audio enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants