Skip to content

Typescript Websocket implementation for the Voicemod Control API

License

Notifications You must be signed in to change notification settings

Bean-Tools/voicemod-websocket

Repository files navigation

voicemod-websocket

TypeScript Websocket Class for Voicemod's Control API. For an overview of the Control API, check out the Control API documentation.

Quickstart

You will need an API key and a running Voicemod.

To create a connection, run:

import { VoicemodwebSocket } from "@bean-tools/voicemod-websocket";

const voicemod = new VoicemodWebSocket();
voicemod.connect("localhost", "aaaaaa-123456");

// Your logic and listeners go here

voicemod.disconnect();

Events

You can find Events you can listen on in the Control API documentation.

They are mapped to the EventTypes type.

You can listen to events with the on() method, i.e.:

voicemod.on("VoiceChanged", (voice) => {
  console.log("Voice changed to", voice.friendlyName);
});