Skip to content

Commit c300eb5

Browse files
authored
Use Miniaudio for audio output (#115)
1 parent dd088b7 commit c300eb5

File tree

27 files changed

+97821
-1753
lines changed

27 files changed

+97821
-1753
lines changed

Makefile.am

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@ if MINGW32
88
W32_LIBS = -lshlwapi
99
endif
1010

11-
if USE_LIBOUT123
12-
OUT123_SOURCES = \
13-
src/audio/out123/audiodrv.cpp \
14-
src/audio/out123/audiodrv.h
15-
endif
16-
1711
if USE_ICONV
1812
ICONV_SOURCES = \
1913
src/codepages.h
@@ -22,12 +16,10 @@ endif
2216
AM_CPPFLAGS = \
2317
-I $(top_builddir)/src \
2418
-I $(top_srcdir)/src \
19+
-I $(top_srcdir)/libs/miniaudio \
2520
-DPKGDATADIR="\"$(pkgdatadir)/\"" \
2621
$(SIDPLAYFP_CFLAGS) \
2722
$(STILVIEW_CFLAGS) \
28-
$(ALSA_CFLAGS) \
29-
$(PULSE_CFLAGS) \
30-
$(OUT123_CFLAGS) \
3123
${W32_CPPFLAGS} \
3224
@debug_flags@
3325

@@ -40,6 +32,9 @@ src/stilview
4032
# sidplayfp
4133

4234
src_sidplayfp_SOURCES = \
35+
libs/miniaudio/osaudio_miniaudio.c \
36+
libs/miniaudio/osaudio.h \
37+
libs/miniaudio/miniaudio.h \
4338
src/IniConfig.cpp \
4439
src/IniConfig.h \
4540
src/args.cpp \
@@ -66,21 +61,12 @@ src/audio/AudioConfig.h \
6661
src/audio/AudioDrv.cpp \
6762
src/audio/AudioDrv.h \
6863
src/audio/IAudio.h \
69-
src/audio/alsa/audiodrv.cpp \
70-
src/audio/alsa/audiodrv.h \
7164
src/audio/au/auFile.cpp \
7265
src/audio/au/auFile.h \
73-
src/audio/directx/audiodrv.cpp \
74-
src/audio/directx/audiodrv.h \
75-
src/audio/mmsystem/audiodrv.cpp \
76-
src/audio/mmsystem/audiodrv.h \
66+
src/audio/miniaudio/audiodrv.cpp \
67+
src/audio/miniaudio/audiodrv.h \
7768
src/audio/null/null.cpp \
7869
src/audio/null/null.h \
79-
src/audio/oss/audiodrv.cpp \
80-
src/audio/oss/audiodrv.h \
81-
$(OUT123_SOURCES) \
82-
src/audio/pulse/audiodrv.cpp \
83-
src/audio/pulse/audiodrv.h \
8470
src/audio/wav/WavFile.cpp \
8571
src/audio/wav/WavFile.h \
8672
src/ini/iniHandler.h \
@@ -90,12 +76,8 @@ src/ini/types.h
9076

9177
src_sidplayfp_LDADD = \
9278
$(LIBICONV) \
93-
$(AUDIO_LDFLAGS) \
9479
$(SIDPLAYFP_LIBS) \
95-
$(BUILDERS_LDFLAGS) \
96-
$(ALSA_LIBS) \
97-
$(PULSE_LIBS) \
98-
$(OUT123_LIBS) \
80+
$(BUILDERS_LDFLAGS)
9981
$(W32_LIBS)
10082

10183
#=========================================================

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,15 @@ In addition to the standard build options the following are available:
6969
compile with debugging messages,
7070
disabled by default
7171

72-
`--with-out123`:
73-
build with the out123 library providing support for additional audio interfaces;
74-
enabled by default
75-
7672
`--with-libiconv-prefix[=DIR]`:
7773
search for libiconv in DIR/include and DIR/lib
7874

7975
the character conversion requires presence of the POSIX/XSI iconv function family in either the C library or a separate libiconv library (see https://www.gnu.org/software/gettext/manual/html_node/AM_005fICONV.html)
76+
77+
-----------------------------------------------------------------------------
78+
79+
# 3rd party software
80+
81+
* miniaudio
82+
https://github.com/mackron/miniaudio
83+
distributed under MIT license

configure.ac

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ AC_CONFIG_MACRO_DIR([m4])
66
AC_CONFIG_HEADERS([src/config.h])
77
AM_INIT_AUTOMAKE
88

9-
10-
119
AC_CANONICAL_HOST
1210
case "$host" in
1311
*mingw* )
@@ -19,7 +17,6 @@ case "$host" in
1917
esac
2018
AM_CONDITIONAL([MINGW32], [test "x$MINGW32" = "xyes"])
2119

22-
2320
AC_PROG_RANLIB
2421

2522
dnl Checks for programs.
@@ -45,60 +42,9 @@ AC_C_BIGENDIAN
4542
AM_ICONV
4643
AM_CONDITIONAL([USE_ICONV], [test "x$am_cv_func_iconv" = "xyes"])
4744

48-
dnl Audio subsystem
49-
50-
AUDIO_LDFLAGS=""
51-
52-
PKG_CHECK_MODULES(ALSA,
53-
[alsa >= 1.0],
54-
[AC_DEFINE([HAVE_ALSA], 1, [Define to 1 if you have libasound (-lasound).])],
55-
[AC_MSG_WARN([$ALSA_PKG_ERRORS])]
56-
)
57-
58-
PKG_CHECK_MODULES(PULSE,
59-
[libpulse-simple >= 1.0],
60-
[AC_DEFINE([HAVE_PULSE], 1, [Define to 1 if you have libpulse-simple (-lpulse-simple).])],
61-
[AC_MSG_WARN([$PULSE_PKG_ERRORS])]
62-
)
63-
64-
65-
dnl Checks what version of Unix we have and soundcard support
66-
AC_CHECK_HEADERS([sys/ioctl.h linux/soundcard.h machine/soundcard.h sys/soundcard.h soundcard.h])
67-
68-
AC_CHECK_HEADERS([dsound.h mmsystem.h], [], [], [#include <windows.h>])
69-
70-
AS_IF([test "$ac_cv_header_dsound_h" = "yes"],
71-
[AUDIO_LDFLAGS="$AUDIO_LDFLAGS -ldsound -ldxguid"]
72-
)
73-
74-
AS_IF([test "$ac_cv_header_mmsystem_h" = "yes"],
75-
[AUDIO_LDFLAGS="$AUDIO_LDFLAGS -lwinmm"]
76-
)
77-
78-
# NetBSD/OpenBSD OSS audio emulation
79-
AS_IF([test "x$ac_cv_header_soundcard_h" = "xyes"],
80-
[AUDIO_LDFLAGS="$AUDIO_LDFLAGS -lossaudio"]
81-
)
82-
83-
AC_SUBST(AUDIO_LDFLAGS)
84-
8545
PKG_CHECK_MODULES(SIDPLAYFP, [libsidplayfp >= 2.0])
8646
PKG_CHECK_MODULES(STILVIEW, [libstilview >= 1.0])
8747

88-
USE_LIBOUT123=no
89-
AC_ARG_WITH([out123], AS_HELP_STRING([--with-out123], [Build with out123 library (default: enabled)]))
90-
91-
AS_IF([test "x$with_out123" != "xno"],
92-
[PKG_CHECK_MODULES([OUT123],
93-
[libout123 >= 1.0],
94-
[USE_LIBOUT123=yes
95-
AC_DEFINE([HAVE_OUT123], [1], [Use libout123])],
96-
[USE_LIBOUT123=no]
97-
)]
98-
)
99-
100-
AM_CONDITIONAL([USE_LIBOUT123], [test "x$USE_LIBOUT123" = "xyes"])
101-
10248
# check for builders
10349
PKG_CHECK_VAR([SIDPLAYPF_INCLUDE], [libsidplayfp], [includedir])
10450

libs/miniaudio/LICENSE

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
This software is available as a choice of the following licenses. Choose
2+
whichever you prefer.
3+
4+
===============================================================================
5+
ALTERNATIVE 1 - Public Domain (www.unlicense.org)
6+
===============================================================================
7+
This is free and unencumbered software released into the public domain.
8+
9+
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
10+
software, either in source code form or as a compiled binary, for any purpose,
11+
commercial or non-commercial, and by any means.
12+
13+
In jurisdictions that recognize copyright laws, the author or authors of this
14+
software dedicate any and all copyright interest in the software to the public
15+
domain. We make this dedication for the benefit of the public at large and to
16+
the detriment of our heirs and successors. We intend this dedication to be an
17+
overt act of relinquishment in perpetuity of all present and future rights to
18+
this software under copyright law.
19+
20+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23+
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
24+
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
25+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26+
27+
For more information, please refer to <http://unlicense.org/>
28+
29+
===============================================================================
30+
ALTERNATIVE 2 - MIT No Attribution
31+
===============================================================================
32+
Copyright 2025 David Reid
33+
34+
Permission is hereby granted, free of charge, to any person obtaining a copy of
35+
this software and associated documentation files (the "Software"), to deal in
36+
the Software without restriction, including without limitation the rights to
37+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
38+
of the Software, and to permit persons to whom the Software is furnished to do
39+
so.
40+
41+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
42+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
43+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
44+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
45+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
46+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
47+
SOFTWARE.

0 commit comments

Comments
 (0)