Archive 17/01/2023.

SoLoud audio library

Bananaft

I hacked together Urho3d and SoLoud audio library: http://soloud-audio.com
I decided to try it after investigating on this issue: Audio artifacts on low frequency sounds

Here is a comparison video, enable CC:

johnnycable

Great! This is definitely welcome! Always find the sound to be hacky. Do you plan to contribute it?

Bananaft

Well, um… yeah, about that…

  1. I’m just learning C++, and I code like no one is watching. I can share my code but it is terrible. And I broke a lot of stuff.
  2. It seems like a big feature, will require setting up build system (I broke it in my repo). Checking if it will work on all platforms Urho supports.
  3. It is better to change interface of audio system to better support SoLoud features (like filters, mixing busses), and that’s a decision for someone smart from core team.
johnnycable

I see. Don’t worry about integrating it, it’s complicated anyway. These days I’m trying to fit turbobadger into Urho, just for the sake of improving…
Anyway, if you don’t mind, you could share some spare code, or simply describe your workflow…
I’d like to try to make this thing work with Android. Android it’s notoriously problematic on sounds, and that would be a real test…

Bananaft

Ok, but you’ve been warned:

I basically took Urho’s audio classes, removed their guts and made them use SoLoud instead. There should be a name for this? Glue code? (edit: wrapper) There are also some dead code, especially in audio.cpp.

I also wrote my own attenuation model.

So I used Urho 1.7 source. I added the library, threw out some exotic file formats that cause build errors, defined backend: #define WITH_SDL2_STATIC

One little problem I ran into is that SoLoud uses #define M_PI for Pi value, and Urho uses static const float M_PI, and they conflict.

Sinoid

One little problem I ran into is that SoLoud uses #define M_PI for Pi value, and Urho uses static const float M_PI, and they conflict.

That’s because you put SoLoud headers into your headers instead of just your sources and forward declaring the SoLoud types. Headers only in the source files after all Urho3D headers, and #undef M_PI if necessary.