ToxMod Client SDK 1.9.0
ToxMod by Modulate
 
Loading...
Searching...
No Matches
ToxMod

Modulate's Voice Chat Moderation Library

The contents of this library are Confidential and Proprietary to Modulate, Inc. They may not be shared or distributed without permission from Modulate. Email suppo.nosp@m.rt@m.nosp@m.odula.nosp@m.te.a.nosp@m.i with requests, bug reports, or questions! Last updated February 13, 2024.

Overview

This library enables realtime moderation of voice chat by detecting disruptive behavior and escalating instances to a human moderation team, or taking autonomous action. This SDK is the beginning of the moderation process: it hooks into a player's live voice chat session and listens to their chat, accumulates information about developer-permitted variables such as game state, conducts initial disruptive behavior triage on-device, and escalates disruptive speech to Modulate's virtual private cloud for analysis.

​ Visit https://console.modulate.ai to view the moderation dashboard and start understanding the nature of voice chat in your game! If you have not received an invitation email to create an account, please send an email to suppo.nosp@m.rt@m.nosp@m.odula.nosp@m.te.a.nosp@m.i and we can assist you from there.

​ The tox/include subdirectory contains the header file exposing the ToxMod API (tox.h). The tox/lib directory contains the associated shared library (tox/lib/libtox.*) as well as a few standard shared library dependencies. These libraries should be distributed with your application or otherwise be available on the end users' devices; in the case of the standard dependencies, if you already include a compatible version of the library (see Dependencies below) feel free to link to those instead.

​ For testing purposes, an example program is distributed in example/, which reads in a .opus file in realtime and moderates it with the ToxMod system.

Dependencies

ToxMod uses libopus.1.3.1 and libopusenc.0.2.1 for audio compression before uploading. Shared libraries for both are included alongside libtox in this release. Place them in the library loading path of your application or ToxMod will not function correctly. ​ ToxMod uses libcurl for audio upload. A DLL for curl (and its dependency zlib) are included in this release for Windows. The library is not provided in other releases, as it comes standard on macOSX and Linux distributions. ​ ToxMod uses libfvad for on-device voice activity detection. This ensures ToxMod will only activate when a user is speaking. The shared library for libfvad is included in this release for all platforms.

Getting Started

The example program (example/main.c) showcases the flow for using ToxMod. The basic steps are:

  1. Call tox_global_init() to initialize the ToxMod library
  2. Call tox_create_instance() with basic player information and account IDs.
  3. Call tox_join_session() with session name when a player joins a voice chat session
  4. Call tox_add_audio_short() or tox_add_audio_float() with buffers of audio samples from the microphone as they become available. Often this is done using a voice chat framework callback after audio is recorded but before it is sent to the voice chat server.
  5. Call tox_leave_session() when a player has left a voice chat session
  6. Call tox_destroy_instance() when a player leaves the game
  7. Call tox_global_cleanup() when ToxMod is no longer needed ​ To build the example program and test the library, on macOSX and Linux enter the example/ directory and run make test. On Windows, open the included Visual Studio project, build it, and run it inside Visual Studio or directly in a command prompt. This will build the test executable, link libtox and its dependencies, and run the example program against a provided test .opus file.