Used for on-device voice cloning with OuteTTS 1.0. Encodes reference audio into discrete codebook indices
that condition the OuteTTS model during synthesis.
1import onnxruntime as ort
2import numpy as np
3
4sess = ort.InferenceSession("dac_encoder_24khz.onnx")
5
6# 1 second of audio at 24kHz
7audio = np.random.randn(1, 1, 24000).astype(np.float32) * 0.1
8
9codes = sess.run(None, {"audio": audio})
10# codes[0].shape = (1, 2, 75) — 2 codebooks, 75 frames
These are interleaved per frame to create the speaker conditioning prompt.