Views
No views yet
kokoro_5s.mlmodelc runs the full pipeline (BERT → duration
prediction → fixed-shape alignment → prosody → decoder) in one CoreML
call. G2P (grapheme-to-phoneme) is a separate pair of CoreML models.| Parameter | Value |
|---|---|
| Parameters | 82M |
| Precision | INT8 k-means palettization |
| Max audio length | 5 s (200 frames @ 40 fps) |
| Sample rate | 24 kHz |
| Style dimension | 256 |
| Max phonemes per pass | 128 |
| File | Size | Description |
|---|---|---|
kokoro_5s.mlmodelc | 83 MB | Pre-compiled E2E model (pre-compiled, loads directly on-device) |
G2PEncoder.mlmodelc | 0.7 MB | Grapheme-to-phoneme encoder |
G2PDecoder.mlmodelc | 0.8 MB | Grapheme-to-phoneme decoder |
voices/ | 0.5 MB | 54 preset voice embeddings (10 languages) |
vocab_index.json | 4 KB | Phoneme vocabulary |
g2p_vocab.json | 4 KB | G2P vocabulary |
us_gold.json, us_silver.json | 6 MB | English pronunciation dictionaries |
pipeline_config.json | 4 KB | Swift pipeline config |
af_heart voice, 14 phonemes) using the same CoreML inference path:| Metric | Value |
|---|---|
| Predicted duration Δ | 0 frames |
| Output sample count | identical |
| Log-spec distance | 0.42 (close to inaudible) |
| SI-SDR waveform | +0.01 dB |
| Size vs FP16 | −74% (83 MB vs 310 MB) |
Package.swift:.package(url: "https://github.com/soniqo/speech-swift", branch: "main")1import KokoroTTS
2
3let tts = try await KokoroTTSModel.fromPretrained(
4 modelId: "aufklarer/Kokoro-82M-CoreML-INT8"
5)
6let audio = try await tts.synthesize(
7 "Hello world, this is a Kokoro test.",
8 voice: "af_heart"
9)swift run audio kokoro "Hello world" --voice af_heart --output out.wav