Skip to content
saugns v0.3.8b. Portability, performance, and cli fixes.

OSS on NetBSD: Use /dev/audio, not /dev/sound.

Check for the AUDIODEV environment variable,
using it to override the default device name
regardless of which type (ALSA, OSS, ...) is
used. Similar to handling in other software,
e.g. SoX and SDL. Empty strings are ignored.
Credit to Art Nikpal (@hyphop at GitHub) for
the basic idea, and SoX code as a reference.
Further refactor player/audiodev code a bit.

Change cli argument parsing to allow a flag to be followed
by its argument without a space in-between. Recognize "--"
as meaning no further strings are flags. Uses SAU_getopt()
derived from Christopher Wellons's public domain getopt().

Makefile changes to selectively use -O3.
Following benchmarking (repeated running
of example/ scripts with -m to time it),
this can have a benefit anywhere from no
to more than 42%, depending on compiler,
etc. (It seems to matter more with GCC.)

Move ramp mulbuf use into the fill functions
and adjust more, allowing mulbuf to be NULL.

Change the mempool to use dynamic sizing of memory blocks,
doubling size when the number of blocks exceeds a power of
four. Use 2048 as the start block size. Doesn't change the
performance significantly with my testing which became too
rough for tiny differences or needs larger volumes of use.