Instructions to use beyoru/MaiLinh-TTS-CoreML with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Piper
How to use beyoru/MaiLinh-TTS-CoreML with Piper:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -87,18 +87,18 @@ with wave.open("out.wav", "wb") as w:
|
|
| 87 |
## CoreML — I/O contract
|
| 88 |
|
| 89 |
**Input**
|
| 90 |
-
- `input` : `[1, 256]` Int32
|
| 91 |
-
- `input_lengths` : `[1]` Int32
|
| 92 |
-
- `scales` : `[3]` Float32
|
| 93 |
|
| 94 |
**Output**
|
| 95 |
- `audio` : Float32 mono 22050Hz, độ dài cố định (M·256 mẫu).
|
| 96 |
-
- `n_frames` : Int32
|
| 97 |
|
| 98 |
## Tích hợp iOS
|
| 99 |
|
| 100 |
1. Kéo `MaiLinh.mlpackage` vào Xcode (tự biên dịch ra `.mlmodelc` khi build).
|
| 101 |
-
2. Dùng `MaiLinhTTS.swift`
|
| 102 |
3. **Phần phải tự làm: phonemize tiếng Việt.** Model nhận *phoneme ids*, không nhận text. Cần `espeak-ng` (voice `vi`) build cho iOS (arm64) đổi text → IPA, rồi map qua `phoneme_id_map` trong `mailinh250626.onnx.json`, chèn pad id `0` giữa các phoneme (logic `phonemes_to_ids` của piper).
|
| 103 |
4. Câu dài > 5.8s: tách câu, tổng hợp từng câu.
|
| 104 |
|
|
|
|
| 87 |
## CoreML — I/O contract
|
| 88 |
|
| 89 |
**Input**
|
| 90 |
+
- `input` : `[1, 256]` Int32 - phoneme ids, pad `0` cho đủ 256.
|
| 91 |
+
- `input_lengths` : `[1]` Int32 - số phoneme id thật (≤256).
|
| 92 |
+
- `scales` : `[3]` Float32 - `[noise=0.667, length=1.0, noise_w=0.8]`; `length>1` đọc chậm hơn.
|
| 93 |
|
| 94 |
**Output**
|
| 95 |
- `audio` : Float32 mono 22050Hz, độ dài cố định (M·256 mẫu).
|
| 96 |
+
- `n_frames` : Int32 - số frame thật. **Cắt `audio` tại `n_frames*256`** rồi fade-out ngắn, cắt đươc noise ở cuối audio.
|
| 97 |
|
| 98 |
## Tích hợp iOS
|
| 99 |
|
| 100 |
1. Kéo `MaiLinh.mlpackage` vào Xcode (tự biên dịch ra `.mlmodelc` khi build).
|
| 101 |
+
2. Dùng `MaiLinhTTS.swift` đã làm sẵn load model, dựng input, chạy, cắt theo `n_frames`, fade-out, phát qua `AVAudioEngine`.
|
| 102 |
3. **Phần phải tự làm: phonemize tiếng Việt.** Model nhận *phoneme ids*, không nhận text. Cần `espeak-ng` (voice `vi`) build cho iOS (arm64) đổi text → IPA, rồi map qua `phoneme_id_map` trong `mailinh250626.onnx.json`, chèn pad id `0` giữa các phoneme (logic `phonemes_to_ids` của piper).
|
| 103 |
4. Câu dài > 5.8s: tách câu, tổng hợp từng câu.
|
| 104 |
|