Implementation
List<String> get manifest => switch (this) {
TtsModelType.matcha => const [
'matcha_textenc_fp16.tflite',
'matcha_decoder_fp16.tflite',
'matcha_vocoder_fp16.tflite',
'dp_g2p_matcha_fp16.tflite',
'g2p_dict.txt.gz',
'emb.bin',
'config.json',
'g2p_meta.json',
],
// litert-community/Qwen3-TTS-12Hz-0.6B-Base on HuggingFace. Entries are
// PLAIN basenames — deliberately NOT the `tables/`/`voices/` subpaths
// those 5 files actually live under on the HF repo (see
// [fetchLocationFor]).
// This is load-bearing, not a simplification: [TtsBundleFile.fromSource]
// derives a file's installed identity (== [TtsBundleFile.prefsKey] ==
// the `artifactPaths` key `Qwen3TtsCore.load`/`Qwen3Tables.load` read)
// from the LAST path segment of its source, and
// `MobileModelManager._restoreActiveTtsModel` independently re-derives
// the SAME namespaced on-disk path directly from this raw manifest
// string (`FileNameUtils.namespaced(modelId, fn)`) — if an entry here
// contained a `/`, those two derivations would silently diverge (fresh
// install writes the URL-extracted flat basename; restore would look for
// a namespaced path with an embedded subdirectory) and active-model
// restore would fail to find the file after every relaunch. No
// `config.json` — Qwen3's sampling params (top_k=50, temperature=0.9,
// repetition_penalty=1.05, max_frames=512) are recipe constants threaded
// as Dart defaults, not model-file-driven.
TtsModelType.qwen3 => const [
'talker_int4.tflite',
'mtp_fp32.tflite',
'codec_decoder_fp32.tflite',
'tokenizer.json',
..._qwen3TableFiles,
'demo_speaker.npy',
],
// Inflect-Nano-v2 (huggingface.co/sasha-denisov/inflect-nano-v2-litert). A
// VITS-style text-encoder + decoder; no separate vocoder (the decoder emits
// waveform directly). Phoneme ids in → 24 kHz PCM out. Inflect uses the
// SAME espeak-style IPA + 178-symbol table as Matcha (verified identical),
// so it REUSES Matcha's G2P bundle (config.json symbol table, g2p_dict word
// dictionary, dp_g2p neural OOV fallback + its meta) — those 4 are fetched
// from the Matcha repo, the 2 tflites from the Inflect repo (per-file
// [TtsModelTypeManifest.sourceFor]).
TtsModelType.inflect => const [
'inflect_text_encoder_fp16.tflite',
'inflect_decoder_fp16.tflite',
'config.json',
'g2p_dict.txt.gz',
'dp_g2p_matcha_fp16.tflite',
'g2p_meta.json',
],
_ => throw UnimplementedError(
'TTS manifest for $this is a follow-on (only matcha/qwen3/inflect are '
'wired)',
),
};