Quickstart: VIVA SDK
Clean a WAV file with the VIVA SDK Voice Isolation model in Python, from download to output file.
In this quickstart you install the VIVA SDK for Python and run the Voice Isolation model on a WAV file. The model removes background voices and noise and writes a cleaned file you can listen to.
The VIVA SDK runs on your own servers, on CPU. Audio never leaves your machine. It is also available for Node.js, Go, Rust, C++ and C: see VIVA SDK Getting Started for samples in each language.
You need:
- Linux (x64, armv8a), Windows (x64) or macOS (x64, armv8a). See Platforms.
- Python 3.10 or later, and
numpy - A 16 kHz, mono, 16-bit PCM WAV file. To convert any audio file with ffmpeg:
ffmpeg -i input.mp3 -ar 16000 -ac 1 -sample_fmt s16 noisy.wavDownload the SDK and models
The VIVA SDK is available on request. In the Developers Portal, open Voice Isolation, click Request access and tell Krisp your platforms and expected volume. A scoping call follows within 1–2 business days. Once access is granted, download the latest VIVA SDK for Python (a wheel file) from Voice Isolation → Downloads. Current SDK versions include the models in the package; for older versions, download the model package from the same tab.
This quickstart uses the Voice Isolation model krisp-viva-vi-tel-v2.5.1.kef, the best noise cancellation for 8–16 kHz audio. See Choose a model for the other models.
Want to try Voice Isolation without an SDK? The Voice Isolation API is self-serve in the Developers Portal.
Install and set your API key
The package contains one wheel per Python version: cp310 and cp311 for Python 3.10 and 3.11, cp312-abi3 for Python 3.12 and later, and cp314-cp314t for free-threaded Python 3.14. Install the one that matches your Python into your virtual environment:
pip install numpy <path to the Krisp wheel file>The usage-reporting (UAR) build of the SDK (krisp-viva-uar-python-sdk) needs your API key: you pass it to globalInit as licenseKey. The SDK doesn't read environment variables itself; this quickstart reads the key from KRISP_VIVA_API_KEY and passes it in. The standard build (krisp-viva-python-sdk) takes no key, so skip this step if you have that one.
export KRISP_VIVA_API_KEY="your-api-key"setx KRISP_VIVA_API_KEY "your-api-key"Create the script
Save this as clean.py. It reads the WAV file in 10 ms frames, runs each frame through a Voice Isolation session and writes the result to a new file.
import os
import sys
import wave
import numpy as np
import krisp_audio
SAMPLE_RATE = 16000
FRAME_SIZE = SAMPLE_RATE // 100 # 10 ms
def log_callback(log_message, log_level):
print(f"[{log_level}] {log_message}", flush=True)
def main(model_path: str, in_path: str, out_path: str) -> None:
api_key = os.environ.get("KRISP_VIVA_API_KEY")
if api_key: # usage-reporting (UAR) build: pass the key as licenseKey
krisp_audio.globalInit("", api_key, None, log_callback, krisp_audio.LogLevel.Off)
else: # standard build: no key
krisp_audio.globalInit("", log_callback, krisp_audio.LogLevel.Off)
model_info = krisp_audio.ModelInfo()
model_info.path = model_path
nc_cfg = krisp_audio.NcSessionConfig()
nc_cfg.inputSampleRate = krisp_audio.SamplingRate.Sr16000Hz
nc_cfg.inputFrameDuration = krisp_audio.FrameDuration.Fd10ms
nc_cfg.outputSampleRate = krisp_audio.SamplingRate.Sr16000Hz
nc_cfg.modelInfo = model_info
session = krisp_audio.NcFloat.create(nc_cfg)
with wave.open(in_path, "rb") as wav:
pcm = np.frombuffer(wav.readframes(wav.getnframes()), dtype=np.int16)
audio = pcm.astype(np.float32) / 32768.0
frames = len(audio) // FRAME_SIZE
cleaned = []
for i in range(frames):
frame = audio[i * FRAME_SIZE:(i + 1) * FRAME_SIZE]
cleaned.append(session.process(frame, 100.0)) # suppression level 0-100
out = np.clip(np.concatenate(cleaned) * 32768.0, -32768, 32767).astype(np.int16)
with wave.open(out_path, "wb") as wav:
wav.setnchannels(1)
wav.setsampwidth(2)
wav.setframerate(SAMPLE_RATE)
wav.writeframes(out.tobytes())
session = None
krisp_audio.globalDestroy()
print(f"Processed {frames} frames ({frames / 100:.1f} s) -> {out_path}")
main(sys.argv[1], sys.argv[2], sys.argv[3])NcFloat.process takes one frame as a 1-D float32 NumPy array and returns the cleaned frame as a new float32 array of the same length. The second argument is the suppression level, 0–100 (default 100).
Run it
python clean.py /path/to/models/krisp-viva-vi-tel-v2.5.1.kef noisy.wav clean.wavThe script prints a summary line, for example for a 12-second file:
Processed 1200 frames (12.0 s) -> clean.wavPlay noisy.wav and clean.wav to hear the difference: background voices and noise are removed and the main speaker stays.
Next steps
Updated 3 days ago

