Skip to content

Reworked Audio Engine to use SoLoud instead of irrKlang #452

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 10 commits into
base: main
Choose a base branch
from

Conversation

adriengivry
Copy link
Member

@adriengivry adriengivry commented Apr 14, 2025

Description

This PR replaces irrKlang by SoLoud.
The objective of this change is to get rid of irrKlang, which isn't very permissive:

  • Requires purchasing a PRO license when shipping a commercial title with Overload
  • No available source-code, so cannot build from sources (dll/libs need to be included, which we are trying to stray away from)

The sound system has been implement to keep the same settings/params as the irrKlang implementation. No regression has been found (yet). One notable advantage of this implementation (using SoLoud) is that Sound resources can now pre-load the audio, instead of loading it on the fly, which could potentially hurt performance.

Review Guidance

Tested without an active audio device, and it works!

[ERROR] 2025-04-15_16-21-20 Failed to initialize the audio engine. Playback requests will be ignored.
[INFO] 2025-04-15_16-21-35 Scene loaded from disk: C:\Users\adrie\GitHub\Cargo\Game\Assets\Scenes\Game.ovscene
[WARNING] 2025-04-15_16-21-38 Unable to play Sounds\Lava.ogg. Audio engine is not valid
[WARNING] 2025-04-15_16-21-38 Unable to play Sounds\Ambient_Music.ogg. Audio engine is not valid
[WARNING] 2025-04-15_16-21-38 Unable to play Sounds\Concrete_Shoes_Walking.wav. Audio engine is not valid
[WARNING] 2025-04-15_16-21-38 Unable to play Sounds\Concrete_Shoes_Running.wav. Audio engine is not valid
[WARNING] 2025-04-15_16-21-38 Unable to play Sounds\Fan.ogg. Audio engine is not valid
[WARNING] 2025-04-15_16-21-38 Unable to play Sounds\Fan.ogg. Audio engine is not valid
[WARNING] 2025-04-15_16-21-38 Unable to play Sounds\Electric_Ambient.ogg. Audio engine is not valid
[WARNING] 2025-04-15_16-21-38 Unable to play Sounds\Alarm.ogg. Audio engine is not valid
[WARNING] 2025-04-15_16-21-38 Unable to play Sounds\Breath.ogg. Audio engine is not valid
[WARNING] 2025-04-15_16-21-38 Unable to play Sounds\Droid_Ambient.ogg. Audio engine is not valid
[WARNING] 2025-04-15_16-21-38 Unable to play Sounds\Electric_Hit.ogg. Audio engine is not valid

To-Do

  • Improve/cleanup sound creation/loading (SoLoud::Wav) to avoid using raw pointers/allocs
  • Try out different backends and choose the best one for our needs: MiniAudio seems to be the best for us right now
  • Update set3dSourceMinMaxDistance to get the same output as irrKlang (will be exposed later)
  • Hide the backend a little bit more I think it's pretty good as-is
  • Fix the audio frame with weird volume (i.e. when hitting play in Cargo/Game, the first audio frame has loud volume/clicks): can reproduce with both MiniAudio and WinMM backends

Related Issues

Fixes #451

@adriengivry adriengivry self-assigned this Apr 14, 2025
@adriengivry adriengivry force-pushed the feature/soloud_audio_engine branch 2 times, most recently from d4f6036 to eba1431 Compare April 14, 2025 18:35
@adriengivry adriengivry force-pushed the feature/soloud_audio_engine branch from eba1431 to 10e3c65 Compare April 14, 2025 18:56
@adriengivry adriengivry added the Refactoring Something that needs a refactoring label Apr 15, 2025
@adriengivry adriengivry marked this pull request as ready for review April 15, 2025 20:14
@adriengivry adriengivry changed the title Updating Audio Engine from irrKlang to SoLoud Reworked Audio Engine to use SoLoud instead of irrKlang Apr 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refactoring Something that needs a refactoring
Development

Successfully merging this pull request may close these issues.

Move away from irrklang to a more permissive audio engine
1 participant