Open full-duplex voice models that hear your tone and speak with one. One GPU with vLLM-Omni, or fully offline on a Mac with MLX. Zero-shot voice cloning, OpenAI Realtime / GPT-Live compatible, free hosted API trial. Apache-2.0.
Python apple-siliconfull-duplexlivekitmacosmlxofflineopen-sourceopenai-realtimeparalinguisticspipecatrealtimespeechspeech-to-speechttsvllmvllm-omnivoice-assistantvoice-cloningzero-shot
"""Shared timing rules for all clients.
- input: a WAV resampled to 24 kHz PCM16, sent in real time in 20 ms chunks, followed by real-time silence (like an open mic)
- speech end: wall-clock time when the chunk containing the last voiced sample (|x| > 500 in the file) was sent
- first audio: wall-clock time when the client first receives an output audio chunk with |x| > 500
- latency = first audio - speech end"""
import time, wave, numpy as np
SR = 24000; STEP = SR // 50; THR = 500
def load(p):
w = wave.open(p); a = np.frombuffer(w.readframes(w.getnframes()), "<i2").astype(np.float32); sr = w.getframerate()
n = int(len(a) * SR / sr); a = np.interp(np.linspace(0, len(a) - 1, n), np.arange(len(a)), a).astype(np.int16)
voiced = np.nonzero(np.abs(a) > THR)[0]; last = int(voiced[-1]) if len(voiced) else len(a) - 1
return a, last // STEP # index of the chunk holding the last voiced sample
def loud(b):
x = np.frombuffer(b, "<i2"); return len(x) > 0 and int(np.abs(x).max()) > THR