veyh/autoptt-ipc

AutoPTT IPC library for Node

★ 0Forks 0TypeScriptGitHub ↗Compare

README

autoptt-ipc

This is the Javascript version of the AutoPTT IPC.

Usage

Tiny example

import IPC from "autoptt-ipc/IPC";
import { Ipc as AutopttIpc, ActivityState } from "autoptt-ipc/autoptt";

const ipc = new IPC;

ipc.onStateChanged = () => {
  console.log(`state changed to ${ipc.state}`); 
};

ipc.onMessageHook = (msg: AutopttIpc) => {
  if (msg.activityStateChanged) {
    const text = (msg.activityStateChanged.aggregateState === ActivityState.INACTIVE)
      ? "mic inactive"
      : "mic active";

    console.log(text);
  }
};

ipc.start();

For actual projects this is used in, look here

Contributors

veyh

Issues