PsarAI-Speech-GGUF
Fast Khmer / English / French speech synthesis for audio.cpp, in the Jarvis voice or a voice cloned from a reference clip, mixed sentences (Khmer + English, Khmer + French) included. Many times faster than real time on GPU (see Speed).
numbers → words → characters → speaker-conditioned T2U (Transformer, CTC over 1,000 mHuBERT-147 speech units,
- unit 4-gram beam search) → durations and pitch → one of two decoders, 24 kHz:
- fast (default for the Jarvis voice): unit HiFi-GAN with speaker + pitch input, ~100× real time;
- flow (clone v3, default when
voice_refis given): our UnitFront (unit + pitch embedding, 4 Transformer layers) → the S3Gen flow-matching decoder (CosyVoice2 design, Chatterbox weights fine-tuned on our units) that continues the reference recording itself (its mel, units and pitch are the in-context prompt) → HiFT vocoder. Zero-shot: any voice, no training per speaker.
Listen
Generated by the audio.cpp server from the GGUF in this family (the Python package gives the same output). Heard is what the PsarAI-Speech ASR transcribes from the audio, automatically (its own spelling slips included).
Jarvis voice (default)
| Text | Listen | Heard | |
|---|---|---|---|
| Khmer | សួស្តី! ថ្ងៃនេះអាកាសធាតុល្អណាស់ ហើយខ្ញុំរីករាយដែលបានជួបអ្នកម្តងទៀត។Hello! The weather is lovely today, and I am happy to see you again. | សួស្តី ថ្ងៃនេះអាកាសធាតុល្អណាស់ ហើយខ្ញុំរីករាយដែលបានជួបអ្នកម្តងទៀត។ | |
| English | Hello! This voice was cloned from a ten-second sample. The weather is lovely today. | hello this voice was closed from a ten second sample the weather is lovely today | |
| French | Bonjour ! Cette voix a été clonée à partir d'un court extrait. Il fait très beau aujourd'hui.Hello! This voice was cloned from a short sample. The weather is lovely today. | bonjour cette voie était clonnée à partir d'un cours extrait il fait très beau aujourd'hui. | |
| Khmer + English | ថ្ងៃនេះ ខ្ញុំមាន meeting ជាមួយ team នៅម៉ោងដប់ ហើយបន្ទាប់មកទៅញ៉ាំបាយ។Today I have a meeting with the team at ten, and then I'll go eat. | ថ្ងៃនេះចុងមានមីទាំងជាមួយទីម និងម៉ោងដប់ ហើយបន្ទាប់បុគទិញញ៉ាំបាយ។ | |
| numbers (km + en) | តម្លៃ 25 ដុល្លារ ក្នុងឆ្នាំ 2026។ The price rose 15% to $1,234.50.Price: 25 dollars in 2026. (numbers are read as words in each language) | តម្លៃម្ភៃប្រាំដុល្លារក្នុងឆ្នាំ ពីរពាន់ម្ភៃប្រាំមួយ។ the prize rose fifteen percent to one thousand two hundred and thirty-four point fifte dollars. |
Zero-shot voice cloning (clone v3)
Each voice from one ~10 s Khmer clip; the same clip speaks Khmer, English and French. Similarity = CAM++ cosine to the reference (two real clips of one speaker ≈ 0.8).
Voice A: elderly woman, warm: reference (9.6 s)
| Text | Cloned | Heard | similarity | |
|---|---|---|---|---|
| Khmer | សួស្តី! ថ្ងៃនេះអាកាសធាតុល្អណាស់ ហើយខ្ញុំរីករាយដែលបានជួបអ្នកម្តងទៀត។Hello! The weather is lovely today, and I am happy to see you again. | សួស្តី ថ្ងៃនេះអាកាសធាតុល្អណាស់ ហើយខ្ញុំរីករាយដែលបានជួបអ្នកម្តងទៀត។ | 0.80 | |
| English | Hello! This voice was cloned from a ten-second sample. The weather is lovely today. | hello this voice was closed from a ten second sample the weather is lovely today | 0.78 | |
| French | Bonjour ! Cette voix a été clonée à partir d'un court extrait. Il fait très beau aujourd'hui.Hello! This voice was cloned from a short sample. The weather is lovely today. | mon jour cette voit été clonée à partir d'un cours extrait. il fait trape aujourd'hui. | 0.72 |
Voice B: middle-aged woman, deep: reference (8.5 s)
| Text | Cloned | Heard | similarity | |
|---|---|---|---|---|
| Khmer | សួស្តី! ថ្ងៃនេះអាកាសធាតុល្អណាស់ ហើយខ្ញុំរីករាយដែលបានជួបអ្នកម្តងទៀត។Hello! The weather is lovely today, and I am happy to see you again. | សួស្តី ថ្ងៃនេះ អាកាសធាតុល្អណាស់ ហើយខ្ញុំរីករាយដែលបានជោគអ្នកម្តងទៀត។ | 0.78 | |
| English | Hello! This voice was cloned from a ten-second sample. The weather is lovely today. | hello his voice was cloned from a ten second sample the weather is lovely today | 0.76 | |
| French | Bonjour ! Cette voix a été clonée à partir d'un court extrait. Il fait très beau aujourd'hui.Hello! This voice was cloned from a short sample. The weather is lovely today. | bonjour cette voie était clonée à partir d'un cours extrait. il fait très beau aujourd'hui. | 0.78 |
Voice C: young man, deep and smooth: reference (8.8 s)
| Text | Cloned | Heard | similarity | |
|---|---|---|---|---|
| Khmer | សួស្តី! ថ្ងៃនេះអាកាសធាតុល្អណាស់ ហើយខ្ញុំរីករាយដែលបានជួបអ្នកម្តងទៀត។Hello! The weather is lovely today, and I am happy to see you again. | សួស្តី ថ្ងៃនេះអាកាសធាតុល្អណាស់ ហើយខ្ញុំរីករាយដែលបានជួបអ្នកម្តងទៀត។ | 0.85 | |
| English | Hello! This voice was cloned from a ten-second sample. The weather is lovely today. | hello this voice was closed from a ten second sample the weather is lovely today | 0.71 | |
| French | Bonjour ! Cette voix a été clonée à partir d'un court extrait. Il fait très beau aujourd'hui.Hello! This voice was cloned from a short sample. The weather is lovely today. | bonjour cette voie a été clonée à partir d'un cours extrait. il fait très beau aujourd'hui. | 0.77 |
Same voice, two engines (Voice C, Khmer):
| Engine | Listen | similarity |
|---|---|---|
| fast (unit HiFi-GAN, ~100× real time) | 0.57 | |
flow (clone v3, default with voice_ref) | 0.85 |
Voice cloning (zero-shot)
Pass a few seconds of clean speech as voice_ref (server); the first 10 s are used:
{"model": "psarai-speech", "input": "សួស្តី លោក។ Good evening, sir.", "voice_ref": "/path/to/reference.wav"}
The reference sets timbre, accent, rhythm and melody. The T2U predicts units, durations and pitch for that
speaker (CAM++ embedding); the flow decoder renders them in the reference's own voice. "options": {"engine": "fast"} uses the HiFi-GAN instead (much faster, copies only voice type).
End-to-end (text → speech → ASR and CAM++ speaker similarity to the reference; 20 held-out clips per group, greedy units, pace 1.07):
| Reference voices | CER fast → flow | similarity fast → flow | two real clips of the speaker |
|---|---|---|---|
| DDD Khmer speakers (held out) | 11.6% → 6.5% | 0.48 → 0.74 | 0.79 |
| designed voices (held out) | 11.5% → 5.7% | 0.48 → 0.80 | 0.83 |
| FLEURS Khmer (noisy real recordings) | 40.8% → 31.5% | 0.36 → 0.72 | – |
| FLEURS English | 39.6% → 19.7% | 0.36 → 0.77 | – |
| FLEURS French | 27.5% → 17.7% | 0.42 → 0.75 | – |
| Jarvis | 5.1% → 4.2% | 0.74 → 0.81 | 0.74 |
| 3 real voices (km / en / fr / mixed sentences) | 20.1% → 13.9% | 0.47 → 0.70 | – |
Pitch also follows the speaker better (mean |log F0 ratio| to the reference: FLEURS Khmer 0.19 → 0.08). The T2U is v3: 12 decoder layers, trained further on ~10,000 clips that clone v3 re-spoke in other voices (mixed, English, French); on 96 held-out sentences in 3 real voices it cut CER from 5.0% to 4.2% (mixed 6.1% → 4.7%). Use clean recordings: noise in the reference is copied as part of the voice. CAM++ is also what the flow decoder is conditioned on, so its similarity numbers are somewhat optimistic; listen.
Numbers are read out in the text's language (the voice itself cannot read digits): 2026, 1 500,50 €,
$25.50, 15%, 14h30 / 10:30, 1er / 3rd, XXIe siècle, 25°C, 120 km/h, -4, 2020-2025, French
phone numbers, Khmer digits (២៥). The language is detected per sentence and script run, so mixed Khmer / English /
French text works; the language option (km, en, fr) forces one.
| Text | Spoken |
|---|---|
តម្លៃ 25 ដុល្លារ ក្នុងឆ្នាំ 2026។ ម៉ោង 14:30 សីតុណ្ហភាព 32°C។ | តម្លៃ ម្ភៃប្រាំ ដុល្លារ ក្នុងឆ្នាំ ពីរពាន់ម្ភៃប្រាំមួយ។ ម៉ោងដប់បួន សាមសិបនាទី សីតុណ្ហភាព សាមសិបពីរអង្សាសេ។ |
The price rose 15% to $1,234.50 in 2026. | The price rose fifteen percent to one thousand two hundred and thirty-four point fifty dollars in twenty twenty-six. |
Il coûte 1 500,50 € en 2026, à 14h30 le 1er mai. | Il coûte mille cinq cents virgule cinquante euros en deux mille vingt-six, à quatorze heures trente le premier mai. |
Number-heavy sentences transcribed back by ASR (chrF, higher is better): Khmer 20 → 80, English 28 → 71, French 21 → 71 with the conversion vs reading the digits.
Speech recognition is a separate repo: PsarAI-Speech-ASR-GGUF (Unsloth Studio shows one task per repo).
Family psarai_speech. It needs audio.cpp with the patch in audiocpp/mms_asr.patch
(families mms_asr, psarai_s2s, psarai_speech; not in upstream audio.cpp).
File
| File | Size | |
|---|---|---|
psarai-speech-f32.gguf | 1.23 GB | fp32: T2U v3 (12 decoder layers) with pitch predictor + unit HiFi-GAN (91M parameters), CAM++ speaker encoder (7M), unit 4-gram tables; clone v3: UnitFront (14M), S3Gen flow encoder + decoder (113M), HiFT vocoder (21M), mHuBERT-147 first 9 layers (73M) + 1,000-unit codebook, WORLD F0 (in the patch), Jarvis voice and prompt |
Quality
20 held-out clips per group, text → speech → ASR (content CER, lower is better) and CAM++ similarity of the speech to the reference voice (higher is better). "Previous" is the October 30 version of this file (Jarvis only).
| Group | previous: CER | this, Jarvis voice: CER | this, cloned: CER | cloned: similarity (previous) | two real clips |
|---|---|---|---|---|---|
| Jarvis texts | 6.8% | 4.7% | 4.9% | 0.74 (0.73) | 0.74 |
| DDD Khmer speakers (held out) | 18.1% | 12.6% | 13.7% | 0.48 (0.02) | 0.79 |
| designed voices (held out) | 12.5% | 10.4% | 12.8% | 0.46 (0.12) | 0.83 |
| FLEURS Khmer | 22.0% | 18.0% | 41.8% | 0.35 (0.14) | – |
| FLEURS English | 8.0% | 7.3% | 39.2% | 0.35 (0.21) | – |
| FLEURS French | 5.0% | 5.5% | 25.3% | 0.39 (0.22) | – |
Greedy units, no listen-back. FLEURS references are noisy real recordings (hence the cloned CER) and their speakers are unknown, so the reference is the clip itself.
Against the Python reference package: identical speech on short sentences, also when cloning (correlation 1.0; flow: reference units / pitch identical, flow mel correlation 1.000, waveform 0.998); on long texts the unit 4-gram beam can take a different, equally good path (floating-point differences between ggml and PyTorch). The number conversion is a C++ port, identical to the Python version on 27,000 test strings.
Speed
RTX 3090, audio.cpp server (times include HTTP and WAV I/O), warm, median of 3, measured while another training job kept the GPU at 100%:
| Text | Jarvis (fast) | cloned, fast | cloned, flow |
|---|---|---|---|
| 3.6 s of speech | 0.037 s (98×) | 0.041 s (85×) | 0.47 s (8×) |
| 6.8 s | 0.053 s (127×) | 0.059 s (111×) | 0.58 s (11×) |
| 67 s (chunked) | 0.55 s (123×) | 0.56 s (117×) | 5.1 s (13×) |
Idle GPU. A reference voice is prepared once (CAM++, mHuBERT units, F0, mel; ~0.3 s) and kept for the next requests (last 8 voices).
Use with audio.cpp
git apply audiocpp/mms_asr.patch # upstream commit 50749561
cmake -S . -B build -DENGINE_ENABLE_CUDA=ON -DAUDIOCPP_MODELS="mms_asr;voxcpm2;psarai_s2s;psarai_speech" && cmake --build build -j
build/bin/audiocpp_cli --task tts --family psarai_speech --model psarai-speech-f32.gguf --backend cuda \
--text "សួស្តី លោក។ Bonsoir, monsieur." --out hello.wav
Server: {"id": "psarai-speech", "family": "psarai_speech", "path": "psarai-speech-f32.gguf", "task": "tts", "mode": "offline"},
then POST /v1/audio/speech ({"model": "psarai-speech", "input": "..."}) → 24 kHz WAV.
Request options: pace (default 1.07, >1 slower), unit_lm (default true), numbers (default true),
language (km / en / fr; default: detected), text_chunk_size (default 300 code points; longer texts are spoken
sentence by sentence with 0.2 s pauses), engine (flow / fast; default: flow with voice_ref, fast for
Jarvis), voice_ref (reference clip to clone; default: Jarvis). Request options go in "options": {...}.
Limitations
- One synthetic voice that imitates a fictional character's voice; the rights to that voice belong to its owners.
- Noisy references still hurt (FLEURS rows). Mixed Khmer + English sentences in a cloned voice are the weakest case (CER ~45%). Rare number formats (fractions, scores) may be read digit by digit or as ranges.
- The flow engine is ~10× slower than the fast one (still faster than real time).
- The Python package's listen-back check (ASR hears the speech and retries) is not in the GGUF.
- Not in upstream audio.cpp: stock builds (and Unsloth's own prebuilt) cannot load
psarai_speech.
License
CC-BY-NC-SA-4.0 (non-commercial, share-alike): the file contains utter-project/mHuBERT-147 weights (CC-BY-NC-SA-4.0), which also define the speech units. Speaker encoder CAM++ (FunASR / 3D-Speaker) and the S3Gen flow decoder + HiFT vocoder (CosyVoice2 design) from ResembleAI/chatterbox (MIT). The patch vendors WORLD DIO / StoneMask (M. Morise, modified BSD).