rlx-tsac
Native Rust TSAC for RLX plus optional wrapper around Fabrice Bellard's TSAC Linux binary — very low bitrate neural audio (~5–8 kb/s @ 44.1 kHz).
The native codec (vendored tsac-ng via FFI) runs on the host with RLX device tags (cpu, metal, cuda, vulkan, …). Reference binaries (original Bellard tsac + standalone tsac-ng) run in a small Docker image for linux/amd64 perf and parity on any host.
Quick start
Perf bench (RLX host vs Docker refs)
RLX runs on the host; Docker only runs the original Bellard binary and standalone tsac-ng:
Prints encode/decode timing for all three engines plus PCM correlation vs the Docker references.
Tolerances: RLX_TSAC_PARITY_MIN_CORR (default 0.92), RLX_TSAC_PARITY_MAX_MSE (default 0.0025).
Bellard parity (Linux x86_64 host, no Docker)
On Linux x86_64 you can compare native RLX against the Bellard binary directly:
Library
use ;
use Device;
let native = open_native?;
let report = bench_perf?;
report.print_summary;
Environment
| Variable | Default | Purpose |
|---|---|---|
RLX_TSAC_DIR |
.cache/tsac |
Weight dir for native codec (*.bin models) |
RLX_TSAC_BIN |
$RLX_TSAC_DIR/tsac |
Override Bellard binary path (host parity only) |
RLX_TSAC_REF_IMAGE |
rlx-tsac-ref |
Docker image for reference benches |
RLX_TSAC_DOCKER_PLATFORM |
linux/amd64 |
Docker platform for reference image |
Options (passed to tsac)
| Flag | Maps to |
|---|---|
-q N |
Quality / bitrate (1–12 joint stereo, 1–9 otherwise) |
-f |
Fast mode — disable Transformer (higher bitrate) |
-s |
Separate stereo channels (default is joint stereo) |
-c N |
Force input channel count |
-v |
Verbose statistics |
Tests
# Linux x86_64 Bellard parity (host, no Docker):
RLX_TSAC_PARITY=1