Revoize SDK C++ API Reference
This page documents the C++ API. Include revoize_sdk.hpp; then use list_names() and get_model_params(name) to get parameters, and init(params) and process(input) to run enhancement. The API throws RevoizeError on failure.
Include: #include "revoize_sdk.hpp" (which includes revoize_sdk.h).
revoize_sdk::ModelParams Type Alias
namespace revoize_sdk {
using ModelParams = const RevoizeModelParams*;
}Pointer to immutable model parameters from get_model_params(name). Do not modify or free.
revoize_sdk::RevoizeError Class
namespace revoize_sdk {
class RevoizeError : public std::runtime_error {
public:
explicit RevoizeError(const char* message);
};
}Thrown when SDK operations fail (e.g. unknown model name, init failure, process failure).
revoize_sdk::list_names Function
Signature
std::vector<std::string> revoize_sdk::list_names();Returns the list of available model names for this build (e.g. "Capella", "Octantis", "Hadar"). Only models enabled in the build are included.
Throws
RevoizeErrorif the underlying C call fails.
Example
#include <iostream>
#include "revoize_sdk.hpp"
int main() {
for (const auto& name : revoize_sdk::list_names())
std::cout << "Available: " << name << "\n";
return 0;
}revoize_sdk::get_model_params Function
Signature
const RevoizeModelParams* revoize_sdk::get_model_params(const std::string& model_name);Returns model parameters for the given name. Use list_names() to discover names.
Parameters
model_name– Model name (e.g."Capella","Octantis","Hadar"). Case-sensitive.
Returns
- Pointer to read-only
RevoizeModelParams. Do not modify or free. Valid for process lifetime.
Throws
RevoizeErrorif the name is unknown or the model is not available in this build.
Example
#include "revoize_sdk.hpp"
int main() {
const RevoizeModelParams* params = revoize_sdk::get_model_params("Capella");
// params->input_chunk_size_samples, params->output_chunk_size_samples, etc.
return 0;
}revoize_sdk::init Function
Signature
void revoize_sdk::init(const RevoizeModelParams* params);Initializes the SDK with the given model parameters. Call once before process().
Parameters
params– Pointer fromget_model_params(name). Must not be null.
Throws
RevoizeErrorifparamsis null or initialization fails.
Example
#include "revoize_sdk.hpp"
int main() {
auto params = revoize_sdk::get_model_params("Capella");
revoize_sdk::init(params);
return 0;
}revoize_sdk::process Function
Signature
std::vector<float> revoize_sdk::process(const std::vector<float>& input);Processes one chunk of input audio and returns the enhanced audio.
WARNING
- Call
init()before using this function. input.size()must equal exactly theinput_chunk_size_samplesof the params passed toinit().- Input sample rate must match the model (see
params->input_sample_rate). Output size will beparams->output_chunk_size_samples.
Parameters
input– Input audio samples (32-bit float, mono). Length must match the model’sinput_chunk_size_samples.
Returns
std::vector<float>of enhanced samples (length = model’soutput_chunk_size_samples).
Throws
RevoizeErrorif processing fails (e.g. SDK not initialized or wrong input size).
Example
#include "revoize_sdk.hpp"
#include <vector>
#include <iostream>
int main() {
try {
const RevoizeModelParams* params = revoize_sdk::get_model_params("Capella");
revoize_sdk::init(params);
std::vector<float> input(params->input_chunk_size_samples, 0.0f);
std::vector<float> output = revoize_sdk::process(input);
std::cout << "Enhanced audio has " << output.size() << " samples\n";
return 0;
} catch (const revoize_sdk::RevoizeError& e) {
std::cerr << "Error: " << e.what() << std::endl;
return 1;
}
}Version Namespace
namespace revoize_sdk::version {
constexpr int major;
constexpr int minor;
constexpr int patch;
constexpr const char* string; // e.g. "1.2.3"
constexpr int number; // e.g. 10203
}