Revoize SDK C API Reference
CModelType
Enum
The CModelType
enum defines the AI models available in the Revoize SDK:
c
typedef enum {
/// **Capella:** A lightweight model designed for real-time applications.
REVOIZE_MODEL_CAPELLA = 0,
/// **Algol:** A generative model with advanced capabilities.
REVOIZE_MODEL_ALGOL = 1,
/// **Regulus:** A lightweight model designed for real-time applications.
REVOIZE_MODEL_REGULUS = 2,
/// **Octantis:** A lightweight model designed for real-time applications.
REVOIZE_MODEL_OCTANTIS = 3
} CModelType;
revoize_init
Function
Signature
c
int revoize_init(CModelType model_type);
The revoize_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 (0=Capella, 1=Algol, 2=Regulus, 3=Octantis).
Returns
0
if initialization is successful.- Non-zero if an error occurs during initialization (e.g., session creation, state setup, or missing model constants).
Example
c
#include "revoize_sdk.h"
int main() {
// Initialize the SDK with the Capella model.
int result = revoize_init(REVOIZE_MODEL_CAPELLA);
if (result != 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
);
The revoize_process
function takes an input audio chunk and returns the enhanced chunk.
WARNING
- Ensure
revoize_init()
is called before using this function. - The
input
should be from a 48 kHz recording. - The
output
buffer must have enough space to store the enhanced audio samples.
Parameters
input
Pointer to input audio samples (48 kHz, single channel).input_len
Number of input samples.output
Pointer to output buffer where enhanced audio will be written.output_len
Pointer to store the number of output samples.
Returns
0
if processing is successful.- Non-zero if an error occurs during processing (e.g., if the SDK has not been initialized).
Safety
This function is unsafe because it takes raw pointers. The caller must ensure:
input
points to a valid array ofinput_len
samplesoutput
points to a valid array with enough space for the outputoutput_len
points to a valid integer
Example
c
#include "revoize_sdk.h"
#include <stdio.h>
#include <stdlib.h>
int main() {
// Initialize the SDK before processing audio.
int result = revoize_init(REVOIZE_MODEL_CAPELLA);
if (result != 0) {
fprintf(stderr, "Failed to initialize Revoize SDK\n");
return 1;
}
// Prepare an audio chunk from a 48 kHz recording.
const size_t num_samples = 480 * 10; // 10 frames of 480 samples each
float* input = (float*)malloc(num_samples * sizeof(float));
if (input == NULL) {
fprintf(stderr, "Failed to allocate input buffer\n");
return 1;
}
// Fill input with some test data
for (size_t i = 0; i < num_samples; i++) {
input[i] = 1.0f;
}
// Allocate output buffer
float* output = (float*)malloc(num_samples * sizeof(float));
if (output == NULL) {
free(input);
fprintf(stderr, "Failed to allocate output buffer\n");
return 1;
}
// Process the audio
size_t output_len = num_samples;
result = revoize_process(input, num_samples, output, &output_len);
if (result != 0) {
free(input);
free(output);
fprintf(stderr, "Failed to process audio\n");
return 1;
}
printf("Enhanced audio has %zu samples\n", output_len);
// Clean up
free(input);
free(output);
return 0;
}