This repo is used to build PortAudio and generate Jai bindings for it. The actual Jai module, suitable for copying elsewhere, is the PortAudio/
subdirectory.
This is all kind of a pain. We could ship prebuilt PortAudio binaries, but as I understand it, we can't ship it with ASIO support, because of Steinberg's license agreement.
Download latest release from https://github.com/PortAudio/portaudio.
Rename the downloaded directory (portaudio-v19.7.0
or similar) to portaudio_src
, in the root directory of this repo.
Download the ASIO SDK from Steinberg and send them a signed license agreement as described here if you haven't already.
Put the downloaded SDK directory in portaudio_src/src/hostapi/asio
and rename it to ASIOSDK
.
There are several options listed in the PortAudio documentation. I think the easiest way to build the static library with ASIO support on multiple operating systems is to just use cmake.
Make an OS-specific build directory, e.g. build_mac
. cd
into it.
Run cmake ../portaudio_src
. (On macOS, pass the additional argument -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"
to build a universal binary.)
Build using the OS-specific toolchain:
On macOS or (probably) Linux, simply make
. This will build both dynamic and static versions.
On Windows, open portaudio.sln
in Visual Studio. Select Release mode and x64 if they are not already selected, and build. This will put dynamic and static libs in Release/
.
Copy the generated static library into the corresponding OS directory in the PortAudio
folder (the final Jai module folder.)
WARNING: This example is very loud! Turn down your speakers!
Look in test/
for scripts that build and run some simple PortAudio examples. This is mainly for sanity checking the PortAudio build itself - nothing to do with Jai.
At this point, you're finally ready to cd
into the PortAudio directory and run jai generate_bindings.jai
. Hopefully this should work properly on Windows and macOS. It's not yet implemented for Linux, as of this first commit.
Once you have generated the bindings, you should be able to compile PortAudio/test/test_portaudio.jai
and verify that you can get the PortAudio version.