File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- // Package portaudio provides Go bindings for PortAudio, compiled from vendored source.
1+ // Package portaudio provides Go bindings for PortAudio.
2+ //
3+ // By default the C sources are compiled directly from the vendored pa_src
4+ // submodule (see portaudio_vendored*.go). Build with -tags portaudio_system to
5+ // link against a system libportaudio via pkg-config instead (portaudio_system.go);
6+ // the Homebrew formula uses this so it depends on the brew `portaudio` formula
7+ // rather than the vendored copy. The Go API below is identical either way.
28package portaudio
39
410/*
5- #cgo CFLAGS: -I${SRCDIR}/pa_src/include -I${SRCDIR}/pa_src/src/common -DPA_LITTLE_ENDIAN -Wno-unused-parameter -Wno-deprecated-declarations
6-
7- #if !__has_include("pa_src/include/portaudio.h")
8- #error "PortAudio submodule not found. Run: git submodule update --init --recursive"
9- #else
10-
11- #include "pa_src/src/common/pa_allocation.c"
12- #include "pa_src/src/common/pa_converters.c"
13- #include "pa_src/src/common/pa_cpuload.c"
14- #include "pa_src/src/common/pa_debugprint.c"
15- #include "pa_src/src/common/pa_dither.c"
16- #include "pa_src/src/common/pa_front.c"
17- #include "pa_src/src/common/pa_process.c"
18- #include "pa_src/src/common/pa_ringbuffer.c"
19- #include "pa_src/src/common/pa_stream.c"
20- #include "pa_src/src/common/pa_trace.c"
21-
22- #include "portaudio.h"
23- #endif
11+ #include <portaudio.h>
2412*/
2513import "C"
2614
Original file line number Diff line number Diff line change 1+ //go:build !portaudio_system
2+
13package portaudio
24
35/*
Original file line number Diff line number Diff line change 1+ //go:build !portaudio_system
2+
13package portaudio
24
35/*
Original file line number Diff line number Diff line change 1+ //go:build portaudio_system
2+
3+ package portaudio
4+
5+ // Link against a system libportaudio (e.g. Homebrew's `portaudio`) instead of
6+ // compiling the vendored sources. Selected with -tags portaudio_system. The
7+ // system library already bundles its host-API backends, so no per-OS backend
8+ // link flags are needed here. pkg-config supplies the include and link flags.
9+
10+ /*
11+ #cgo pkg-config: portaudio-2.0
12+ */
13+ import "C"
Original file line number Diff line number Diff line change 1+ //go:build !portaudio_system
2+
3+ package portaudio
4+
5+ // Vendored PortAudio: the cross-platform core sources are compiled directly into
6+ // this package (a cgo unity build). The per-OS host APIs and their backend link
7+ // flags live in portaudio_<os>.go. Build with -tags portaudio_system to link a
8+ // system libportaudio instead, in which case none of these sources compile.
9+
10+ /*
11+ #cgo CFLAGS: -I${SRCDIR}/pa_src/include -I${SRCDIR}/pa_src/src/common -DPA_LITTLE_ENDIAN -Wno-unused-parameter -Wno-deprecated-declarations
12+
13+ #if !__has_include("pa_src/include/portaudio.h")
14+ #error "PortAudio submodule not found. Run: git submodule update --init --recursive (or build with -tags portaudio_system to use a system libportaudio)"
15+ #else
16+
17+ #include "pa_src/src/common/pa_allocation.c"
18+ #include "pa_src/src/common/pa_converters.c"
19+ #include "pa_src/src/common/pa_cpuload.c"
20+ #include "pa_src/src/common/pa_debugprint.c"
21+ #include "pa_src/src/common/pa_dither.c"
22+ #include "pa_src/src/common/pa_front.c"
23+ #include "pa_src/src/common/pa_process.c"
24+ #include "pa_src/src/common/pa_ringbuffer.c"
25+ #include "pa_src/src/common/pa_stream.c"
26+ #include "pa_src/src/common/pa_trace.c"
27+ #endif
28+ */
29+ import "C"
Original file line number Diff line number Diff line change 1+ //go:build !portaudio_system
2+
13package portaudio
24
35/*
Original file line number Diff line number Diff line change 1515package livekitcli
1616
1717const (
18- Version = "2.16.5 "
18+ Version = "2.16.6 "
1919)
You can’t perform that action at this time.
0 commit comments