rodrigodzf / Jack-Audio-For-Unity

Jack Audio support for Unity3d
MIT License
30 stars 7 forks source link

Jack Audio For Unity

openupm GitHub

Introduction

This library/plugin enables multichannel audio routing between Unity3D and JackAudio.

Installation

The prefered method of installation is using OpenUPM

Windows

Install Jack v1.9.11 by following the instructions on the Jack Audio website. Make sure the JackRouter.dll is registered in your system.

Important: If you want to use a different Jack version, you have to compile the plugin from source by yourself.

macOS

Install jackOSX Version 0.92_b3 binaries from jackaudio.org/downloads

Linux

Install the appropiate package for your plattform from the website.

Use

Make sure Jack is Running first.

If you use linux, it is highly recommended you use Cadence to avoid misconfiguration of Jack.

Your Jack settings might look similar to these.

Your Jack settings might look similar to these.

Import the JackAudio.unitypackage in your project and make sure Unity audio settings are the default ones.

Some important things to consider while setting up your project:

There are two ways of using this plugin. As an audio filter or as an effect.

As an audio filter component, the JackSend script must be attached to a GameObject with an AudioSource.

As an 'effect', you can add the 'Jack Send' effect to the appropiate Mixer Group.

To configure and connect Unity to the Jack server please use the Jack Editor Window under Window -> Jack

Caveats

For Windows:

Compiling the plugin

In linux, you can use the included CMakeLists.txt to build the library:

cd UnityJack
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j

In Windows you need to give a hint to where the jack libraries are found, for example:

cd UnityJack
cmake -S . -B build -A x64 -DJACK_LIB_DIR="C:\Program Files (x86)\Jack\lib" -DJACK_HEADER_DIR="C:\Program Files (x86)\Jack\includes" -DCMAKE_BUILD_TYPE=Release

And then build the generated project with Visual Studio.

The default precompiled jack headers are a little old in windows and have to be altered in order to compile, refer to this commit