Skip to content

Revoize SDK C API Reference

This page documents the C API. Include revoize_sdk.h, then use revoize_get_model_params(name) to get parameters and revoize_init / revoize_process to run enhancement.

Include the header: #include "revoize_sdk.h"

Model parameters are obtained by name via revoize_get_model_params(model_name); do not construct RevoizeModelParams manually.

Constants

  • REVOIZE_SDK_MAX_MODEL_NAME_LEN – Maximum length of a model name string including null terminator (64). Use for buffer sizing when calling revoize_list_names.

RevoizeModelParams Struct

Model parameters. Obtain only via revoize_get_model_params(). The returned pointer refers to read-only storage; do not modify or free it. Valid for the process lifetime.

c
typedef struct RevoizeModelParams {
    unsigned int model_type;                 /* Reserved for SDK use; do not set. */
    unsigned int input_chunk_size_samples;   /* Required input chunk size in samples. */
    unsigned int output_chunk_size_samples;  /* Output chunk size in samples. */
    unsigned int input_sample_rate;         /* Required input sample rate in Hz. */
    unsigned int output_sample_rate;        /* Output sample rate in Hz. */
} RevoizeModelParams;

revoize_list_names Function

Signature

c
int revoize_list_names(char* names_buffer, unsigned int* count);

Returns the list of available model names using a two-call pattern.

Two-call pattern

  1. First call: Pass names_buffer = NULL. On return, *count is the number of names.
  2. Second call: Allocate a buffer of (*count * REVOIZE_SDK_MAX_MODEL_NAME_LEN) bytes, pass it as names_buffer and the same count. Each name is written as a null-terminated string in REVOIZE_SDK_MAX_MODEL_NAME_LEN bytes per slot.

Parameters

  • names_buffer – When NULL, only the count is returned. Otherwise, buffer for the names.
  • count – On input (when buffer non-NULL): maximum names to write. On output: number of names (or required count when buffer too small).

Returns

  • 0 on success.
  • 1 invalid arguments (e.g. count is NULL).
  • 2 buffer too small; *count is set to the required count.

Example

c
#include <stdlib.h>
#include <stdio.h>
#include "revoize_sdk.h"

int main(void) {
    unsigned int count = 0;
    if (revoize_list_names(NULL, &count) != 0) return 1;
    char* buf = malloc(count * REVOIZE_SDK_MAX_MODEL_NAME_LEN);
    if (!buf) return 1;
    if (revoize_list_names(buf, &count) != 0) { free(buf); return 1; }
    for (unsigned int i = 0; i < count; i++)
        printf("%s\n", &buf[i * REVOIZE_SDK_MAX_MODEL_NAME_LEN]);
    free(buf);
    return 0;
}

revoize_get_model_params Function

Signature

c
const RevoizeModelParams* revoize_get_model_params(const char* model_name);

Returns model parameters for the given name. Use revoize_list_names() to discover names (e.g. "Capella", "Octantis", "Hadar").

Parameters

  • model_name – Null-terminated model name (case-sensitive).

Returns

  • Pointer to read-only RevoizeModelParams on success. Do not modify or free. Valid for process lifetime.
  • NULL if the name is unknown or the model is not available in this build.

Example

c
const RevoizeModelParams* params = revoize_get_model_params("Capella");
if (!params) {
    fprintf(stderr, "Model not available\n");
    return 1;
}
// Use params->input_chunk_size_samples, params->output_chunk_size_samples, etc.

revoize_init Function

Signature

c
int revoize_init(const RevoizeModelParams* params);

Initializes the SDK. Call once before revoize_process(). The pointer must come from revoize_get_model_params().

Parameters

  • params – Pointer from revoize_get_model_params(model_name). Must not be NULL.

Returns

  • 0 on success.
  • Non-zero on failure (e.g. invalid or unavailable model).

Example

c
const RevoizeModelParams* params = revoize_get_model_params("Capella");
if (!params || revoize_init(params) != 0) {
    fprintf(stderr, "Failed to initialize Revoize SDK\n");
    return 1;
}
return 0;

revoize_process Function

Signature

c
int revoize_process(const float* input, size_t input_len, float* output, size_t* output_len);

Processes one chunk of input audio and writes the enhanced audio into output.

WARNING

  • Call revoize_init() before using this function.
  • input_len must equal exactly the input_chunk_size_samples of the RevoizeModelParams used in revoize_init().
  • Input sample rate must match the model (see params->input_sample_rate). Allocate output for at least params->output_chunk_size_samples samples. On success, *output_len is the number of samples written.
  • Audio format: 32-bit float, mono.

Parameters

  • input – Input audio samples (32-bit float, mono).
  • input_len – Number of input samples (must equal params->input_chunk_size_samples).
  • output – Output buffer (must have space for at least output_chunk_size_samples).
  • output_len – On input: size of output in samples. On output: number of samples written.

Returns

  • 0 on success.
  • Non-zero on failure (e.g. SDK not initialized, wrong input length, or processing error).

Example

c
#include "revoize_sdk.h"
#include <stdlib.h>
#include <stdio.h>

int main(void) {
    const RevoizeModelParams* params = revoize_get_model_params("Capella");
    if (!params || revoize_init(params) != 0) {
        fprintf(stderr, "Failed to initialize Revoize SDK\n");
        return 1;
    }

    float* input = malloc(params->input_chunk_size_samples * sizeof(float));
    float* output = malloc(params->output_chunk_size_samples * sizeof(float));
    if (!input || !output) {
        free(input);
        free(output);
        return 1;
    }
    /* Fill input with audio... */

    size_t output_len = params->output_chunk_size_samples;
    int ret = revoize_process(input, params->input_chunk_size_samples, output, &output_len);
    if (ret != 0) {
        fprintf(stderr, "Failed to process audio\n");
    } else {
        printf("Enhanced audio has %zu samples\n", output_len);
    }

    free(input);
    free(output);
    return ret != 0 ? 1 : 0;
}

Version Functions

  • revoize_get_version_string() – Returns version string (e.g. "1.2.3").
  • revoize_get_version_number() – Returns version as integer (e.g. 1.2.3 → 10203).