Skip to content

Revoize SDK C++ API Reference

ModelType Enum

The ModelType enum defines the AI models available in the Revoize SDK:

cpp
namespace revoize_sdk {
    enum class ModelType {
        /// **Capella:** A lightweight model designed for real-time applications.
        Capella,
        /// **Algol:** A generative model with advanced capabilities.
        Algol,
        /// **Regulus:** A lightweight model designed for real-time applications.
        Regulus,
        /// **Octantis:** A lightweight model designed for real-time applications.
        Octantis
    };
}

init Function

Signature

cpp
namespace revoize_sdk {
    void init(ModelType model_type);
}

The init function is your starting point for using the Revoize SDK. It sets up the SDK with the specified model type. Note: Make sure to call this function before any other SDK functions to ensure everything is properly set up.

Parameters

  • model_type The model type to initialize the SDK with.

Returns

  • void on success.

Throws

  • std::runtime_error if initialization fails at any step (e.g., during ONNX session creation or state setup).

Example

cpp
#include "revoize_sdk.hpp"

int main() {
    try {
        // Initialize the SDK with the Capella model.
        revoize_sdk::init(revoize_sdk::ModelType::Capella);
        return 0;
    } catch (const std::exception& e) {
        std::cerr << "Error: " << e.what() << std::endl;
        return 1;
    }
}

process Function

Signature

cpp
namespace revoize_sdk {
    std::vector<float> process(const std::vector<float>& audio_chunk);
}

The process function takes an input audio chunk and returns the enhanced chunk.

WARNING

  • Ensure init() is called before using this function.
  • The audio_chunk should be from a 48 kHz recording.
  • The input must be a vector of float values.

Parameters

  • audio_chunk A vector of float values representing single-channel audio samples recorded at 48 kHz.

Returns

  • A std::vector<float> containing the enhanced audio samples.

Throws

  • std::runtime_error if the SDK is not properly initialized or if the processing fails.

Example

cpp
#include "revoize_sdk.hpp"
#include <vector>
#include <iostream>

int main() {
    try {
        // Initialize the SDK first
        revoize_sdk::init(revoize_sdk::ModelType::Capella);

        // Create an example audio chunk (e.g., 10 frames of 480 samples each)
        std::vector<float> audio_chunk(4800, 1.0f);
        std::vector<float> enhanced_audio = revoize_sdk::process(audio_chunk);

        std::cout << "Enhanced audio has " << enhanced_audio.size() << " samples" << std::endl;
        return 0;
    } catch (const std::exception& e) {
        std::cerr << "Error: " << e.what() << std::endl;
        return 1;
    }
}