Skip to content

Revoize SDK Python API Reference

ModelType Enum

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

python
class ModelType(Enum):
    """**Capella:** A lightweight model designed for real-time applications."""
    CAPELLA = "Capella"
    """**Algol:** A generative model with advanced capabilities."""
    ALGOL = "Algol"
    """**Regulus:** A lightweight model designed for real-time applications."""
    REGULUS = "Regulus"
    """**Octantis:** A lightweight model designed for real-time applications."""
    OCTANTIS = "Octantis"

init Function

Signature

python
def init(model_type: ModelType) -> None

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

  • None on success.

Raises

  • ValueError if the provided model type is invalid (i.e., if its value is not one of the allowed values).
  • RuntimeError if initialization fails at any step (e.g., during ONNX session creation or state setup).

Example

python
import revoize_sdk

# Initialize the SDK with the Capella model.
revoize_sdk.init(revoize_sdk.ModelType.CAPELLA)

process Function

Signature

python
def process(audio_chunk: numpy.ndarray) -> numpy.ndarray

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 one-dimensional NumPy array of float32 values.

Parameters

  • audio_chunk A 1-D NumPy array of float32 values representing single-channel audio samples recorded at 48 kHz.

Returns

  • A NumPy array of float32 containing the enhanced audio samples.

Raises

  • ValueError if audio_chunk is not a one-dimensional array.
  • RuntimeError if the SDK is not properly initialized or if the processing fails.

Example

python
import numpy as np
import revoize_sdk

# Initialize the SDK first
revoize_sdk.init(revoize_sdk.ModelType.CAPELLA)

# Create an example audio chunk (e.g., 10 frames of 480 samples each)
audio_chunk = np.ones(4800, dtype=np.float32)
enhanced_audio = revoize_sdk.process(audio_chunk)
print("Enhanced audio has", len(enhanced_audio), "samples")