Replace BASS audio library with an open source alternative
BASS works well, but it's closed source so it probably worth looking a good open source alternative. The first attempt was with Qt Multimedia but it didn't support opus well enough, later support for playing midi files was added but Qt Multimedia doesn't support that at all (plugins seem to exist), because of that and just general lack of maintenance lead to the complete removal of optional support for Qt Multimedia.
The requirements for an alternative would be:
- Open Source
- A developer willing to maintain it
- Good support for Opus, MP3, Vorbis (Ogg), LPCM/PCM (WAV) and MIDI
- Support for streaming by http/https
- Low latency for sound effects
- Support for: Windows, Linux, Mac and Android
This might be promising. http://sol.gfxile.net/soloud/
This might be promising. http://sol.gfxile.net/soloud/
SoLoud:
- [x] Open Source
- [ ] Opus (No support for opus)
- [x] MP3
- [x] Vorbis (Ogg)
- [x] LPCM/PCM (WAV)
- [x] MIDI
- [ ] Support for streaming by http/https (no built-in support for this)
- [ ] Low latency for sound effects (Maybe? Needs testing)
- [x] Windows
- [x] Linux
- [x] Mac
- [x] Android
extra points:
- [x] Emscripten
- [x] FLAC
I reviewed the library. Don't like it. Decoding depends on single file libraries which don't seem to have enough attention by the community to identify security issues or maintain the library if their author decides to stop maintaining. It is probably easy to fork it to use reliable third-party libraries instead, but then I would have to maintain the library myself.
I'm more concerned with audio mixing than I am with loading audio.
Related to @sus-impost0r's suggestion around FFmpeg, Qt Multimedia now has an FFmpeg backend since Qt 6.4 (released today).
export QT_MEDIA_BACKEND=ffmpeg
https://doc-snapshots.qt.io/qt6-6.4/qtmultimedia-index.html#target-platform-and-backend-notes
+1 for going to QtMultimedia if the backend proves to be versatile enough to replace BASS. Keeping ourselves to a low amount of external dependencies outside of Qt makes deployment and maintaining the client easier.