termux-tts 1.1.5 β 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +91 -8
- package/README.pypi.md +25 -18
- package/doc.config.yaml +517 -83
- package/package.json +2 -2
- package/pyproject.toml +2 -2
- package/setup.py +2 -2
- package/termux_tts/__init__.py +63 -47
- package/termux_tts/audio.py +24 -1
- package/termux_tts/cli.py +52 -7
- package/termux_tts/control/component.py +53 -0
- package/termux_tts/engine.py +250 -162
- package/termux_tts/engine_expressive.py +216 -0
- package/termux_tts/engine_onnx.py +5 -195
- package/termux_tts/engine_sherpa.py +248 -0
- package/termux_tts/engine_vulkan.py +210 -0
- package/termux_tts/installer.py +158 -0
- package/tests/test_expressive_presets.py +0 -29
- package/tests/test_g2p_korean.py +0 -73
- package/tests/test_granular_tts.py +0 -141
- package/tests/test_native_engine.py +0 -38
- package/tests/test_onnx_engine.py +0 -48
- package/tests/test_vulkan_routing.py +0 -52
package/README.md
CHANGED
|
@@ -1,31 +1,114 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Termux-TTS
|
|
2
2
|
|
|
3
|
-
[](https://pypi.org/project/termux-tts/)
|
|
4
|
+
[](https://pypi.org/project/termux-tts/)
|
|
5
|
+
[](https://www.npmjs.com/package/termux-tts)
|
|
6
|
+
[](https://github.com/uno-km/termux-tts)
|
|
4
7
|
|
|
5
|
-
>
|
|
6
|
-
> **
|
|
8
|
+
> Production-Grade 4-Tier On-Device Speech Synthesis Framework (Zero-Dependency DSP Formant, C++ Vulkan GPU Neural Engine & Android Native Voice Bridge)
|
|
7
9
|
|
|
8
10
|
---
|
|
9
11
|
|
|
10
|
-
##
|
|
12
|
+
## Architecture & Overview
|
|
11
13
|
|
|
14
|
+
Termux-TTS is an enterprise-grade, on-device text-to-speech framework optimized for mobile edge hardware and Android Termux environments. Built to eliminate heavy dependency stacks and fragile driver behaviors, it features a resilient 4-Tier architecture:
|
|
12
15
|
|
|
16
|
+
- **Tier 1: Zero-Dependency Parametric DSP Formant Vocoder**: 0MB disk footprint, Rosenberg glottal pulse formulation, and 5-band biquad formant filters providing deterministic speech synthesis in under 50 milliseconds (RTF 0.013x).
|
|
17
|
+
- **Tier 2: Android System Native Voice Bridge**: Direct IPC integration to physical Samsung and Google speech engines via the Termux-API service layer.
|
|
18
|
+
- **Tier 3: Subprocess-Isolated Sherpa C++ CPU Engine**: Subprocess-isolated VITS acoustic modeling on ARM64 NEON with memory leak protection.
|
|
19
|
+
- **Tier 4: Pure Vulkan GPU Hardware Neural Engine**: High-performance GPU tensor synthesis via precompiled native C++ binaries (`sherpa-ncnn-offline-tts-vulkan`) running high-resolution studio models (`vits-piper-en_US-lessac-high-fp16`) with zero silent CPU fallback.
|
|
13
20
|
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Empirical Hardware Benchmarks (Physical Devices)
|
|
24
|
+
|
|
25
|
+
Measurements gathered on physical Android 16 hardware running Termux ARM64:
|
|
26
|
+
|
|
27
|
+
| Target Device | Hardware Architecture | Synthesis Engine | Model Profile | Audio Length | Synthesis Time | Real-Time Factor (RTF) | Status |
|
|
28
|
+
| :--- | :--- | :--- | :--- | :---: | :---: | :---: | :---: |
|
|
29
|
+
| **Galaxy S25** | Snapdragon 8 Elite / Adreno 830 | Vulkan GPU Neural | `lessac-high-fp16` | 6.70 s | **6.65 s** | **0.993x** | Validated |
|
|
30
|
+
| **Galaxy S25** | Snapdragon 8 Elite / Adreno 830 | Vulkan GPU Neural | `lessac-medium` | 4.59 s | **1.21 s** | **0.264x** | Validated |
|
|
31
|
+
| **Galaxy A35** | Exynos 1380 / Mali-G68 MP5 | Vulkan GPU Neural | `lessac-medium` | 4.52 s | **5.18 s** | **1.146x** | Validated |
|
|
32
|
+
| **Galaxy A35** | Exynos 1380 / Mali-G68 MP5 | Vulkan GPU Neural | `lessac-high-fp16` | 6.73 s | **34.33 s** | **5.098x** | Validated |
|
|
33
|
+
| **ARM64 CPU** | Cortex-A78 / A55 | Parametric DSP | 5-Band Biquad | 4.15 s | **0.054 s** | **0.0130x** | Validated |
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Installation & 1-Click Provisioning
|
|
38
|
+
|
|
39
|
+
### 1. Package Installation
|
|
40
|
+
```bash
|
|
41
|
+
# Python SDK & CLI
|
|
42
|
+
pip install termux-tts
|
|
43
|
+
|
|
44
|
+
# Node.js / TypeScript
|
|
45
|
+
npm install termux-tts
|
|
46
|
+
```
|
|
14
47
|
|
|
48
|
+
### 2. Automated Engine & Weights Provisioning
|
|
49
|
+
Automate the installation of precompiled ARM64 Vulkan C++ binaries and HuggingFace weights with self-test verification:
|
|
50
|
+
```bash
|
|
51
|
+
# Install Studio Tier (22.05kHz High-Fidelity)
|
|
52
|
+
termux-tts install --tier high
|
|
53
|
+
|
|
54
|
+
# Or install Medium Tier (Balanced Performance)
|
|
55
|
+
termux-tts install --tier medium
|
|
56
|
+
```
|
|
15
57
|
|
|
16
58
|
---
|
|
17
59
|
|
|
18
|
-
##
|
|
60
|
+
## Quickstart
|
|
61
|
+
|
|
62
|
+
### Global Command-Line Interface (CLI)
|
|
63
|
+
```bash
|
|
64
|
+
# Synthesize using Vulkan GPU with speaker playback
|
|
65
|
+
termux-tts synth -e vulkan --tier high -t "Speech synthesis via Vulkan GPU." -o out.wav --play
|
|
66
|
+
|
|
67
|
+
# Instant DSP Formant synthesis
|
|
68
|
+
termux-tts synth -e dsp -t "Zero dependency DSP synthesis." -o dsp.wav
|
|
69
|
+
|
|
70
|
+
# Direct hardware speaker broadcast
|
|
71
|
+
termux-tts speak -t "Hardware speaker broadcast." -l en
|
|
72
|
+
|
|
73
|
+
# Hardware diagnostics
|
|
74
|
+
termux-tts doctor
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Python SDK
|
|
78
|
+
```python
|
|
79
|
+
import termux_tts as tts
|
|
80
|
+
|
|
81
|
+
# High-Resolution Vulkan GPU Neural Synthesis
|
|
82
|
+
with tts.load(engine="vulkan", model_tier="high") as engine:
|
|
83
|
+
result = engine.synthesize("Pure Vulkan neural execution on mobile.", output="speech.wav")
|
|
84
|
+
print(f"Synthesized in {result.elapsed_ms:.1f}ms (RTF: {result.rtf:.4f}x)")
|
|
85
|
+
|
|
86
|
+
# Zero-Dependency DSP Formant Synthesis
|
|
87
|
+
with tts.load(engine="dsp", preset="balanced") as engine:
|
|
88
|
+
result = engine.synthesize("Instant speech without model downloads.", output="dsp.wav")
|
|
89
|
+
print(f"DSP Latency: {result.elapsed_ms:.1f}ms")
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Node.js / TypeScript
|
|
93
|
+
```typescript
|
|
94
|
+
import * as tts from 'termux-tts';
|
|
19
95
|
|
|
96
|
+
async function main() {
|
|
97
|
+
const engine = tts.load({ engine: 'vulkan', tier: 'high' });
|
|
98
|
+
const res = await engine.synthesize("High performance speech synthesis.", { output: "speech.wav" });
|
|
99
|
+
console.log(`Synthesized in ${res.elapsedMs}ms`);
|
|
100
|
+
}
|
|
101
|
+
main();
|
|
102
|
+
```
|
|
20
103
|
|
|
21
104
|
---
|
|
22
105
|
|
|
23
|
-
##
|
|
106
|
+
## Official Documentation & Benchmarks
|
|
24
107
|
- [Official Architecture & API Reference](https://uno-km.vercel.app/lib/tts/)
|
|
25
108
|
- [Ecosystem Metrics & Registry Stats](https://uno-km.vercel.app/foundation/metrics)
|
|
26
109
|
- [AMEVA Open-Source Foundation Portal](https://uno-km.vercel.app/foundation/index.html)
|
|
27
110
|
|
|
28
111
|
---
|
|
29
112
|
|
|
30
|
-
##
|
|
113
|
+
## License
|
|
31
114
|
Licensed under the Apache-2.0 License. Copyright (c) 2026 Eunho Kim ([@uno-km](https://github.com/uno-km)).
|
package/README.pypi.md
CHANGED
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
[](https://pypi.org/project/termux-tts/)
|
|
5
5
|
[](https://github.com/uno-km/termux-tts)
|
|
6
6
|
|
|
7
|
-
>
|
|
8
|
-
> Supports Zero-Dependency Parametric DSP Formant Vocoder, Deep Learning ONNX Neural Runtime, and Android Native System Voice Bridge.
|
|
7
|
+
> Production-Grade 4-Tier On-Device Speech Synthesis Framework for Mobile & Edge (Zero-Dependency DSP Formant, C++ Vulkan GPU Neural Engine & Android Native Voice Bridge)
|
|
9
8
|
|
|
10
9
|
## Installation
|
|
11
10
|
|
|
@@ -13,30 +12,39 @@
|
|
|
13
12
|
pip install termux-tts
|
|
14
13
|
```
|
|
15
14
|
|
|
15
|
+
### 1-Click Automated Engine Provisioning
|
|
16
|
+
```bash
|
|
17
|
+
termux-tts install --tier high
|
|
18
|
+
```
|
|
19
|
+
|
|
16
20
|
## Quickstart
|
|
17
21
|
|
|
18
22
|
```python
|
|
19
23
|
import termux_tts as tts
|
|
20
24
|
|
|
21
|
-
# 1.
|
|
22
|
-
with tts.load(engine="
|
|
23
|
-
|
|
24
|
-
print(f"
|
|
25
|
+
# 1. Studio Vulkan GPU Neural Engine
|
|
26
|
+
with tts.load(engine="vulkan", model_tier="high") as engine:
|
|
27
|
+
result = engine.synthesize("Neural speech synthesis on mobile GPU.", output="speech.wav")
|
|
28
|
+
print(f"Elapsed: {result.elapsed_ms:.1f}ms (RTF: {result.rtf:.4f}x)")
|
|
25
29
|
|
|
26
|
-
# 2.
|
|
27
|
-
with tts.load(engine="
|
|
28
|
-
|
|
30
|
+
# 2. Zero-Dependency DSP Formant Mode
|
|
31
|
+
with tts.load(engine="dsp", preset="balanced") as engine:
|
|
32
|
+
result = engine.synthesize("Instant speech generation.", output="dsp.wav")
|
|
33
|
+
print(f"DSP Latency: {result.elapsed_ms:.1f}ms")
|
|
29
34
|
|
|
30
|
-
# 3. Android
|
|
31
|
-
with tts.load(engine="native", language="
|
|
32
|
-
engine.speak("
|
|
35
|
+
# 3. Direct Android Native Speaker Output
|
|
36
|
+
with tts.load(engine="native", language="en") as engine:
|
|
37
|
+
engine.speak("Direct hardware speaker output.")
|
|
33
38
|
```
|
|
34
39
|
|
|
35
|
-
##
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
+
## Benchmarks (Physical Devices)
|
|
41
|
+
|
|
42
|
+
| Target Device | Hardware Architecture | Synthesis Engine | Real-Time Factor (RTF) | Status |
|
|
43
|
+
| :--- | :--- | :--- | :---: | :---: |
|
|
44
|
+
| **Galaxy S25** | Snapdragon 8 Elite / Adreno 830 | Vulkan GPU (`lessac-high-fp16`) | **0.993x** | Validated |
|
|
45
|
+
| **Galaxy S25** | Snapdragon 8 Elite / Adreno 830 | Vulkan GPU (`lessac-medium`) | **0.264x** | Validated |
|
|
46
|
+
| **Galaxy A35** | Exynos 1380 / Mali-G68 MP5 | Vulkan GPU (`lessac-medium`) | **1.146x** | Validated |
|
|
47
|
+
| **ARM64 CPU** | All Core Profiles | Parametric DSP Formant | **0.0130x** | Validated |
|
|
40
48
|
|
|
41
49
|
## Documentation
|
|
42
50
|
- [Official Documentation & API Reference](https://uno-km.vercel.app/lib/tts/)
|
|
@@ -44,4 +52,3 @@ with tts.load(engine="native", language="ko") as engine:
|
|
|
44
52
|
|
|
45
53
|
## License
|
|
46
54
|
Apache-2.0 License. Copyright (c) 2026 Eunho Kim (@uno-km).
|
|
47
|
-
|