Skip to content

C++ native plugin demo

A minimal C++ shared library that implements the ViveEngine native plugin interface. It shows the full plugin lifecycle — creation, audio processing, message handling, and teardown — in plain C++, with no external dependencies beyond vive_plugin.h.

It's part of the ViveSound SDK, and it implements the native plugin interface defined in vive_plugin.h.

Features

The plugin applies a tremolo effect — it periodically modulates the amplitude of the audio using a low-frequency oscillator:

  • Reads the active audio encoding (sample rate and channel count) during initialization
  • Scales every sample in each frame by an LFO value that varies over time
  • Accepts out-of-band control messages to adjust the rate and depth of the modulation at runtime

It's intentionally small — the goal is to show the wiring, not build a production effect.

What it demonstrates

  • How to implement the four exported functions the engine expects: vive_plugin_new, vive_plugin_process_frame, vive_plugin_process_message, and vive_plugin_delete
  • How to use the vive_context callbacks to negotiate the audio encoding and read custom configuration at startup
  • How to process audio frames in place on the audio thread

Native plugins run directly inside the engine process, so they add zero latency beyond the processing time itself. See How it works for background on how native and managed plugins compare.

Learn more