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) -> NoneThe 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_typeThe model type to initialize the SDK with.
Returns
Noneon success.
Raises
ValueErrorif the provided model type is invalid (i.e., if its value is not one of the allowed values).RuntimeErrorif 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.ndarrayThe process function takes an input audio chunk and returns the enhanced chunk.
WARNING
- Ensure
init()is called before using this function. - The
audio_chunkshould be from a 48 kHz recording. - The input must be a one-dimensional NumPy array of
float32values.
Parameters
audio_chunkA 1-D NumPy array offloat32values representing single-channel audio samples recorded at 48 kHz.
Returns
- A NumPy array of
float32containing the enhanced audio samples.
Raises
ValueErrorifaudio_chunkis not a one-dimensional array.RuntimeErrorif 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")