Introduction
This module contains all the logic related to the Zwerm3 audio system, providing functions to manage Jack and Jacktrip processes, as well as related operations. Basically, we wrote a library around the CLI commands of both Jack and Jacktrip and automated the processes of the audio and streaming protocol. With spawn
and spawnSync
of the NodeJS library we start the commands and log out the output if necessary.
If you want to manage the audio server and streaming, use these software tools:
- Use QJackCtl for Jack
- Use Jacktrip GUI
More information about both libraries can be found on:
Source
- You can find the GitHub repository of
zwerm3-jack
here. - You can find the current published version on npm
Installation
You can install this package in your node project using npm or yarn
npm install @zwerm3/jack
or
yarn add @zwerm3/jack
Import a function via the ES6 import syntax to use this in your project
import { connectChannel } from "@zwerm3/jack";
Binaries
By default, this library uses the Jack binaries installed on the local computer. Installation can be done via HomeBrew on macOS or by following the jack docs for Windows. Note that the Jacktrip binaries are by default sourced from the resources folder, and currently, only macOS and Linux (arm/x64) binaries are compiled. To make the package lighter we will delete the resources folder in the near future.
It is recommended to specify custom paths. You can configure this by overriding jackFolderPath
and jacktripBinPath
in the exported Zwerm3Jack
object before invoking any functions.
import { Zwerm3Jack } from "@zwerm3/jack";
Zwerm3Jack.default.jackFolderPath = "/usr/local/bin";
Zwerm3Jack.default.jacktripBinPath = "/home/user/dev/jacktrip";
Functions
This node module exports a comprehensive set of functions and modules for managing Jack and Jacktrip functionalities. These exports cover various aspects including:
Jack
connectChannel
: Connects a channel within the Jack system.disconnectChannel
: Disconnects a channel within the Jack system.getJackHubClients
: Gets a list of Jack Hub clients.getJackPaths
: Retrieves paths related to the local Jack binaries.getJackSystemClients
: Gets a list of Jack system clients.isJackDmpRunning
: Checks if the Jack daemon (jackdmp
) is running.startJackDmp
: Starts the Jack daemon (jackdmp
).startJackDmpAsync
: Asynchronously starts the Jack daemon (jackdmp
).
Jacktrip
getJacktripPaths
: Retrieves paths related to the local Jacktrip binaries.isJacktripRunning
: Checks if Jacktrip is running.startJacktripHubServer
: Starts a Jacktrip Hub server.startJacktripHubServerAsync
: Asynchronously starts a Jacktrip Hub server.startJacktripHubClient
: Starts a Jacktrip Hub client.startJacktripHubClientAsync
: Asynchronously starts a Jacktrip Hub client.startJacktripP2PServer
: Starts a Jacktrip peer-to-peer (P2P) server.startJacktripP2PServerAsync
: Asynchronously starts a Jacktrip peer-to-peer (P2P) server.startJacktripP2PClient
: Starts a Jacktrip peer-to-peer (P2P) client.startJacktripP2PClientAsync
: Asynchronously starts a Jacktrip peer-to-peer (P2P) client.startJacktriptP2PMultipleClientsAsync
: Asynchronously starts multiple Jacktrip peer-to-peer (P2P) clients.
Process Management
getRunningProcesses
: Retrieves information about running processes.killAllProcesses
: Kills all running processes (Jack and Jacktrip).killJack
: Kills the Jack process.killJacktrip
: Kills the Jacktrip process.killProcessByPid
: Kills a process based on its process ID (PID).