[Maybe useful to interpreter authors] SDL_audiolib library

This might be of interest to people writing interpreters:

I wanted to write a new audio engine for QTads and Hugor, since they currently use SDL_mixer and/or SDL_sound. Those have quite a few problems associated with them.

Instead of making the new audio code specific to those two interpreters, I instead opted to make a library out of it. It’s in early stage at the moment and only tested on Linux (I will obviously need to make sure it works on Windows and Mac later on.) It’s LGPL licensed. I’m announcing this here in case people plan to use it at some point, and have any suggestions or want some specific functionality added (or even want to contribute in the development.)

It uses three different resamplers: Speex (the Opus version), SoxR and SRC (libsamplerate). The Speex one is integrated. The others need their respective external libraries. Resampling only happens when the source signal’s sample rate doesn’t match the output rate to the audio device.

It does floating point mixing of any amount of audio sources. I hope to add some features like dithering and a limiter in the future, for the audiophiles

The audio sources come from decoders. The included decoders rely on libvorbis, opusfile, libmpg123, libsndfile, libmodplug and libfluidsynth to play many different sound formats (Ogg/Vorbis, Ogg/Opus, MP3, FLAC, MOD-based files, MIDI, WAV, AIFF, etc.) There is no limit to the amount of audio streams that can play simultaneously.

There is only a C++ API at the moment, and it will break and change on a daily basis. This is version 0.0.0

I’m hoping to add a C API too in the future, which emulates SDL_mixer (with some added functions) which would serve as an API and ABI compatible drop-in replacement for programs using SDL_mixer. (There’s a bit of that already, but it’s mostly just stub functions; not really useful yet.)

If you’re interested in this, it’s on GitHub:

github.com/realnc/SDL_audiolib

and the API documentation (always in flux, maybe some parts missing):

realnc.github.io/SDL_audiolib

The docs show a quick “hello world” program on the main page.