Downloads · 30 days
0
Prince-1/VibeVoice-AcousticTokenizer-Onnx
VibeVoice-AcousticTokenizer-Onnx is a feature extraction model from Prince-1. Use it when you need embeddings to search or compare text. It is set up for onnxruntime. The card lists the license as mit.
VibeVoice is a novel framework designed for generating expressive, long-form, multi-speaker conversational audio, such as podcasts, from text. It addresses significant challenges in traditional Text-to-Speech (TTS) sy…
Downloads · 30 days
0
Access
Public
Updated Jul 22, 2026
Repo size
7 GB
Likes
0
Public
Click a slice to open those files.
.onnx4.2 GB · 100%
From the Hugging Face model README
VibeVoice is a novel framework designed for generating expressive, long-form, multi-speaker conversational audio, such as podcasts, from text. It addresses significant challenges in traditional Text-to-Speech (TTS) systems, particularly in scalability, speaker consistency, and natural turn-taking.
A core innovation of VibeVoice is its use of continuous speech tokenizers (Acoustic and Semantic) operating at an ultra-low frame rate of 7.5 Hz. These tokenizers efficiently preserve audio fidelity while significantly boosting computational efficiency for processing long sequences. VibeVoice employs a next-token diffusion framework, leveraging a Large Language Model (LLM) to understand textual context and dialogue flow, and a diffusion head to generate high-fidelity acoustic details.
The speech tokenizer is a key component for both VibeVoice TTS and ASR.
➡️ Technical Report: VibeVoice Technical Report
➡️ Project Page: microsoft/VibeVoice
<p align="left"> <img src="figs/tokenizer_comparison.png" alt="Tokenizer Comparison" height="250px"> </p>| Model | Context Length | Length (min) | Weight |
|---|---|---|---|
| VibeVoice-Realtime-0.5B | 8K | ~10 min | HF link |
| VibeVoice-1.5B | 64K | ~90 min | HF link |
| VibeVoice-ASR | 64K | ~60 min | HF link |
| VibeVoice-AcousticTokenizer | - | - | This model |
ONNX conversion of microsoft/VibeVoice-AcousticTokenizer
— the continuous acoustic speech tokenizer (VAE codec) shared by VibeVoice
TTS and ASR.
It operates at an ultra-low 7.5 Hz frame rate (hop = 3200 samples @ 24 kHz), encoding waveform to a
64-dim latent per frame and decoding it back.
Exported with Olive (dynamo → ONNX). No PyTorch / transformers needed at runtime — only onnxruntime + numpy (+ soundfile/librosa for audio I/O).
This tokenizer is shared across the VibeVoice family — the same acoustic codec feeds the TTS and
ASR models — so inference_tokenizer.py is the general encode/decode driver, usable standalone or as
the codec front/back-end of any VibeVoice ONNX pipeline.
| file | in → out | notes |
|---|---|---|
acoustic_encoder.onnx | audio [1,1,24000] → latents [1,7,64] | fixed 1 s input (24000 samples → 7 frames) |
acoustic_decoder.onnx | latents [B,frames,64] → audio [B,1,3200*frames] | dynamic frame count |
inference_tokenizer.py | — | encode/decode driver (prints the encoder→latents→decoder flow) |
Two precisions: fp32/ (1.3 GB, reference) and fp16/ (≈0.7 GB). int4 is not provided — the
tokenizer is a conv VAE with no MatMul weights to quantize (int4 would be a no-op = fp32).
Encoder length is baked at 24000 samples. The PyTorch model accepts arbitrary length; this ONNX encoder processes exactly 1 s per call, so longer audio is encoded in 1 s chunks (zero-padded to a whole number of chunks) and the latents concatenated. The decoder is dynamic — it decodes any number of frames in one pass.
acoustic_inference.pydoes the chunking for you.
pip install onnxruntime numpy soundfile librosa
# GPU: pip install onnxruntime-gpu (and pass --cuda)
The ONNX equivalent of the model card's model.encode(...) / model.decode(...):
import numpy as np, onnxruntime as ort, soundfile as sf, librosa
SR, CHUNK = 24_000, 24_000 # 24 kHz; encoder input is fixed at 1 s
def sess(p):
so = ort.SessionOptions(); so.log_severity_level = 3
return ort.InferenceSession(p, so, providers=["CPUExecutionProvider"])
enc, dec = sess("fp32/acoustic_encoder.onnx"), sess("fp32/acoustic_decoder.onnx")
npdt = np.float16 if "float16" in enc.get_inputs()[0].type else np.float32
# load + resample to 24 kHz, mono
wav, sr = sf.read("en-Alice_woman.wav", dtype="float32", always_2d=False)
if wav.ndim > 1: wav = wav.mean(1)
if sr != SR: wav = librosa.resample(wav, orig_sr=sr, target_sr=SR)
# ENCODE — 1 s chunks (encoder is fixed at 24000 samples) -> concat latents
n = int(np.ceil(len(wav) / CHUNK))
wav = np.pad(wav, (0, n * CHUNK - len(wav)))
latents = np.concatenate(
[enc.run(["latents"], {"audio": wav[i*CHUNK:(i+1)*CHUNK][None, None, :].astype(npdt)})[0]
for i in range(n)], axis=1) # [1, 7*n, 64]
print("Latent shape:", latents.shape)
# DECODE — dynamic, one pass -> 3200 samples per frame
audio = dec.run(["audio"], {"latents": latents.astype(npdt)})[0].ravel()
sf.write("reconstructed.wav", audio, SR, subtype="PCM_16")
print("Reconstructed:", audio.shape)
Or just use the driver (prints the encoder → latents → decoder flow):
python inference_tokenizer.py --models-dir fp32 --input en-Alice_woman.wav --output reconstructed.wav
python inference_tokenizer.py --models-dir fp32 --input in.wav --latents-out codes.npy --encode-only
python inference_tokenizer.py --models-dir fp32 --latents-in codes.npy --output out.wav --decode-only
python inference_tokenizer.py --models-dir fp16 --input in.wav --output out.wav # fp16
Example flow output:
[encode] 24000 samples (1.00s) @ 24000 Hz -> 1 x 24000 chunk(s), fp32
encoder: audio[1,1,24000] -> latents[1, 7, 64] (chunk 1/1)
[decode] decoder: latents[1,7,64] -> audio[1,1,22400] (0.93s, 3200/frame)
saved -> reconstructed.wav round-trip corr=+0.999
Component parity (ONNX vs VibeVoiceAcousticTokenizerModel) and codec round-trip on a synthetic tone:
| encoder | decoder | codec round-trip | |
|---|---|---|---|
| fp32 | cos 0.999 | cos 0.94¹ | corr +0.999, SNR +22.8 dB |
| fp16 | cos 0.999 | cos 0.94¹ | corr +0.998, SNR +22.7 dB |
¹ the decoder's cosine is measured on near-silent output (random latents ≈ silence), where max|Δ| ≈ 1e-10 — numerically identical, cosine is just noise-dominated (standard neural-codec eval caveat).
op_block_list (ConstantOfShape/ConvTranspose/Resize/Range)
kept in fp32 — those shape/resample ops produce invalid graphs under fp16 conversion and gain nothing.use_cache / padding_cache in the PyTorch API) is not exported here — these are
fixed-context encode/decode graphs. Streaming would need the cached-state variants exported separately.padding_cache) path.AutoFeatureExtractor just formats a mono 24 kHz waveform (pad_to_multiple_of=3200);
the ONNX encoder takes the raw [1,1,24000] tensor directly, so no feature-extractor is required.