Skip to main content

Interfaces and Types

JackPaths

This interface defines the paths for the Jack audio server binaries.

PropertyTypeDescription
jackConnectstringPath to the jack_connect command.
jackDisconnectstringPath to the jack_disconnect command.
jackDmpstringPath to the jack_dmp command.
jackLspstringPath to the jack_lsp command.

Example Usage:

const jackPaths: JackPaths = {
jackConnect: "/usr/bin/jack_connect",
jackDisconnect: "/usr/bin/jack_disconnect",
jackDmp: "/usr/bin/jack_dmp",
jackLsp: "/usr/bin/jack_lsp",
};

JacktripPaths

This interface defines the paths for the Jacktrip audio server binaries.

PropertyTypeDescription
jackTripstringPath to the jacktrip command.

Example Usage:

const jacktripPaths: JacktripPaths = {
jackTrip: "/usr/bin/jacktrip",
};

JackPathsOptions

This interface defines the options for the Jack audio server.

PropertyTypeDescription
jackVersionstringVersion of the Jack audio server.

Example Usage:

const jackPathsOptions: JackPathsOptions = {
jackVersion: "1.9.12",
};

JacktripParams

This interface defines the parameters for Jacktrip.

PropertyTypeDescription
channelsnumberNumber of channels to use.
debugbooleanEnable debug mode.
queueBuffernumberSize of the queue buffer in milliseconds.
realtimePrioritybooleanSet the process to real-time priority.
localPortnumberLocal port to listen on.
connectDefaultAudioPortsbooleanConnect to the default audio ports.

Example Usage:

const jacktripParams: JacktripParams = {
channels: 2,
debug: false,
queueBuffer: 100,
realtimePriority: true,
localPort: 4444,
connectDefaultAudioPorts: true,
};

JacktripHubServerParams

This interface extends the JacktripParams interface and defines the parameters for the Jacktrip hub server.

PropertyTypeDescription
hubPatchModeHubPatchModePatch mode for the hub server.

Example Usage:

const jacktripHubServerParams: JacktripHubServerParams = {
...jacktripParams,
hubPatchMode: HubPatchMode.Auto,
};

JacktripHubClientParams

This interface extends the JacktripParams interface and defines the parameters for the Jacktrip hub client.

PropertyTypeDescription
bitRateBitRateBit rate for the hub client.
clientNamestringName of the hub client.
hoststringHostname or IP address of the hub server.
receiveChannelsnumberNumber of receive channels for the hub client.
redundancynumberRedundancy level for the hub client.
sendChannelsnumberNumber of send channels for the hub client.
remotePortnumberRemote port to connect to.

Example Usage:

const jacktripHubClientParams: JacktripHubClientParams = {
...jacktripParams,
bitRate: BitRate.High,
clientName: "MyHubClient",
host: "192.168.1.100",
receiveChannels: 2,
redundancy: 2,
sendChannels: 2,
remotePort: 5555,
};

JacktripP2PServerParams

This interface extends the JacktripParams interface and defines the parameters for the Jacktrip P2P server.

PropertyTypeDescription
bitRateBitRateBit rate for the P2P server.
clientNamestringName of the P2P server.
receiveChannelsnumberNumber of receive channels for the P2P server.
redundancynumberRedundancy level for the P2P server.
sendChannelsnumberNumber of send channels for the P2P server.

Example Usage:

const jacktripP2PServerParams: JacktripP2PServerParams = {
...jacktripParams,
bitRate: BitRate.High,
clientName: "MyP2PServer",
receiveChannels: 2,
redundancy: 2,
sendChannels: 2,
};

JacktripP2PClientParams

This interface extends the JacktripP2PServerParams interface and defines the parameters for the Jacktrip P2P client.

PropertyTypeDescription
hoststringHostname or IP address of the P2P server.
remotePortnumberRemote port to connect to.

Example Usage:

const jacktripP2PClientParams: JacktripP2PClientParams = {
...jacktripP2PServerParams,
host: "192.168.1.100",
remotePort: 5555,
};

JackParams

This interface defines the parameters for the Jack audio server.

PropertyTypeDescription
devicestringName of the audio device.
inputChannelsnumberNumber of input channels.
outputChannelsnumberNumber of output channels.
sampleRatenumberSample rate in Hz.
bufferSizenumberBuffer size in samples.
periodsnumberNumber of periods.

Example Usage:

const jackParams: JackParams = {
device: "default",
inputChannels: 2,
outputChannels: 2,
sampleRate: 44100,
bufferSize: 1024,
periods: 2,
};

JacktripP2PClient

This interface defines the properties of a Jacktrip P2P client.

PropertyTypeDescription
localPortnumberLocal port used by the client.
clientNamestringName of the client.
hoststringHostname or IP address of the P2P server.

Example Usage:

const jacktripP2PClient: JacktripP2PClient = {
localPort: 4444,
clientName: "MyP2PClient",
host: "192.168.1.100",
};

RunningCommand

This interface defines the properties of a running command.

PropertyTypeDescription
commandstringThe command that is running.
pidnumberThe process ID of the running command.
paramsJacktripParamsThe parameters used for the running command.

Example Usage:

const runningCommand: RunningCommand = {
command: "jacktrip",
pid: 1234,
params: jacktripP2PClientParams,
};

HubClients

This interface defines the properties of hub clients.

PropertyTypeDescription
sendChannelsstring[]Array of send channel names.
receiveChannelsstring[]Array of receive channel names.

Example Usage:

const hubClients: HubClients = {
sendChannels: ["send1", "send2"],
receiveChannels: ["receive1", "receive2"],
};

SystemClients

This interface defines the properties of system clients.

PropertyTypeDescription
captureChannelsstring[]Array of capture channel names.
playbackChannelsstring[]Array of playback channel names.

Example Usage:

const systemClients: SystemClients = {
captureChannels: ["capture1", "capture2"],
playbackChannels: ["playback1", "playback2"],
};

ChannelConnection

This interface defines the properties of a channel connection.

PropertyTypeDescription
sourcestringThe source channel name.
destinationstringThe destination channel name.

Example Usage:

const channelConnection: ChannelConnection = {
source: "send1",
destination: "receive1",
};

Config

This interface defines the properties of a configuration.

PropertyTypeDescription
unitnumberThe unit number.

Example Usage:

const config: Config = {
unit: 1,
};

OptionalParams

This interface defines optional parameters for functions.

PropertyTypeDescription
onLog(message: string) => voidA callback function for logging messages.

Example Usage:

const optionalParams: OptionalParams = {
onLog: (message: string) => {
console.log(message);
},
};